Skip to content

Commit 69309fe

Browse files
committed
make debugging of transient failure a bit easier
1 parent fff392c commit 69309fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/function/PFunction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public PFunction(String name, String qualname, String enclosingClassName, PCode
7272
super(PythonBuiltinClassType.PFunction, PythonBuiltinClassType.PFunction.newInstance());
7373
this.name = name;
7474
this.qualname = qualname;
75+
assert code != null;
7576
this.code = code;
7677
this.enclosingClassName = enclosingClassName;
7778
this.globals = globals;
@@ -146,6 +147,7 @@ public PCode getCode() {
146147

147148
public void setCode(PCode code) {
148149
codeStableAssumption.invalidate("code changed for function " + getName());
150+
assert code != null : "code cannot be null";
149151
this.code = code;
150152
}
151153

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/builtins/FunctionNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ public static GetFunctionCodeNode create() {
206206
@GenerateUncached
207207
public abstract static class GetSignatureNode extends PNodeWithContext {
208208
private static Signature doFunctionInternal(GetFunctionCodeNode getFunctionCodeNode, PFunction function) {
209-
return getFunctionCodeNode.execute(function).getSignature();
209+
PCode code = getFunctionCodeNode.execute(function);
210+
return code.getSignature();
210211
}
211212

212213
public abstract Signature execute(Object function);

0 commit comments

Comments
 (0)