Skip to content

Commit a35c460

Browse files
committed
Add a sanity check that the context is correct when executing a RubyRootNode
1 parent e488a1a commit a35c460

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/truffleruby/language/RubyRootNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.truffleruby.language;
1111

1212
import org.truffleruby.RubyContext;
13+
import org.truffleruby.RubyLanguage;
1314
import org.truffleruby.language.methods.SharedMethodInfo;
1415

1516
import com.oracle.truffle.api.Assumption;
@@ -57,6 +58,7 @@ public RubyRootNode(
5758

5859
@Override
5960
public Object execute(VirtualFrame frame) {
61+
assert RubyLanguage.getCurrentContext() == context;
6062
context.getSafepointManager().poll(this);
6163
return body.execute(frame);
6264
}

0 commit comments

Comments
 (0)