Skip to content

Commit f2096e8

Browse files
committed
[GR-71979] Fix VerifierInstrument to correctly handle resume event in languages.
PullRequest: graal/22838
2 parents 71fb023 + 0e80caf commit f2096e8

File tree

1 file changed

+8
-1
lines changed
  • truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation

1 file changed

+8
-1
lines changed

truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import com.oracle.truffle.api.CompilerDirectives;
5151
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
5252
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
53+
import com.oracle.truffle.api.frame.FrameSlotKind;
5354
import com.oracle.truffle.api.frame.MaterializedFrame;
5455
import com.oracle.truffle.api.frame.VirtualFrame;
5556
import com.oracle.truffle.api.impl.Accessor;
@@ -256,6 +257,12 @@ public void onReturnExceptional(EventContext context, VirtualFrame frame, Throwa
256257

257258
private static final class RootFrameChecker implements ExecutionEventListener {
258259

260+
@Override
261+
public void onResume(EventContext context, VirtualFrame frame) {
262+
// Overridden to prevent the default delegation to onEnter. For a coroutine resume, the
263+
// frame doesn't have to be empty
264+
}
265+
259266
@Override
260267
public void onEnter(EventContext context, VirtualFrame frame) {
261268
checkFrameIsEmpty(context, frame.materialize());
@@ -271,7 +278,7 @@ private static void checkFrameIsEmpty(EventContext context, MaterializedFrame fr
271278
if (frame.isStatic(slot)) {
272279
Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", defaultValue, frame.getObjectStatic(slot));
273280
Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", 0L, frame.getLongStatic(slot));
274-
} else {
281+
} else if (frame.getTag(slot) != FrameSlotKind.Illegal.tag) {
275282
Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", defaultValue, frame.getValue(slot));
276283
}
277284
}

0 commit comments

Comments
 (0)