Skip to content

Commit dda8714

Browse files
committed
Improve assertion messages
1 parent f64806e commit dda8714

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/frame/MaterializeFrameNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public final PFrame executeOnStack(boolean markAsEscaped, boolean forceSync, Fra
152152
*/
153153
public final PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
154154
assert !PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER || frameToMaterialize.getArguments().length != 2 : "caller forgot to unwrap continuation frame";
155-
assert !PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER || !(location instanceof PBytecodeDSLRootNode) : location.getClass().getSimpleName();
155+
assert !PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER || !(location instanceof PBytecodeDSLRootNode) : String.format("Materialized frame: location must not be PBytecodeDSLRootNode, was: %s",
156+
location);
156157
return executeImpl(location, markAsEscaped, forceSync, frameToMaterialize);
157158
}
158159

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/AsyncHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import com.oracle.graal.python.builtins.objects.function.PArguments;
6262
import com.oracle.graal.python.builtins.objects.function.Signature;
6363
import com.oracle.graal.python.nodes.PRootNode;
64+
import com.oracle.graal.python.nodes.bytecode_dsl.PBytecodeDSLRootNode;
6465
import com.oracle.graal.python.nodes.call.CallDispatchers;
6566
import com.oracle.graal.python.nodes.call.CallNode;
6667
import com.oracle.graal.python.nodes.frame.ReadCallerFrameNode;
@@ -170,6 +171,8 @@ public final void execute(PythonContext context, Access access) {
170171
// IndirectCalleeContext.enter and transfer the state from thread state to
171172
// the frame. If we were woken-up in middle of Python frame code, we will
172173
// have to do a stack walk, but we still need the location
174+
assert !PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER ||
175+
!(location instanceof PBytecodeDSLRootNode) : String.format("Async action: location must not be PBytecodeDSLRootNode, was: %s", location);
173176
prev = EncapsulatingNodeReference.getCurrent().set(location);
174177
}
175178
try {

0 commit comments

Comments
 (0)