Skip to content

Commit 762a6a4

Browse files
committed
Remove invalid PRaiseNode#raiseExceptionObject(Object)
* It used `this` as the Node but `this` is an inlined node and so is not a correct Node location for the backtrace.
1 parent ea05b46 commit 762a6a4

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/codecs/ErrorHandlers.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,9 @@ abstract static class RaiseEncodeException extends Node {
983983

984984
@Specialization
985985
static void doIt(VirtualFrame frame, Node inliningTarget, ErrorHandlerCache cache, TruffleString encoding, TruffleString srcObj, int startPos, int endPos, TruffleString reason,
986-
@Cached MakeEncodeExceptionNode makeEncodeExceptionNode,
987-
@Cached PRaiseNode raiseNode) {
986+
@Cached MakeEncodeExceptionNode makeEncodeExceptionNode) {
988987
cache.exceptionObject = makeEncodeExceptionNode.execute(frame, inliningTarget, cache.exceptionObject, encoding, srcObj, startPos, endPos, reason);
989-
raiseNode.raiseExceptionObject(cache.exceptionObject);
988+
PRaiseNode.raiseExceptionObject(inliningTarget, cache.exceptionObject);
990989
}
991990
}
992991

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/exception/PBaseException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,10 @@ boolean isException() {
299299
@ExportMessage
300300
RuntimeException throwException(
301301
@Bind Node node,
302-
@Cached PRaiseNode raiseNode,
303302
@Shared("gil") @Cached GilNode gil) {
304303
boolean mustRelease = gil.acquire();
305304
try {
306-
throw raiseNode.raiseExceptionObject(this);
305+
throw PRaiseNode.raiseExceptionObject(node, this);
307306
} finally {
308307
gil.release(mustRelease);
309308
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PRaiseNode.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ public final PException raiseBadInternalCall(Node inliningTarget) {
229229
throw raise(inliningTarget, PythonBuiltinClassType.SystemError, BAD_ARG_TO_INTERNAL_FUNC);
230230
}
231231

232-
public final PException raiseExceptionObject(Object exc) {
233-
throw raiseExceptionObject(this, exc, PythonOptions.isPExceptionWithJavaStacktrace(PythonLanguage.get(this)));
234-
}
235-
236232
public static PException raiseExceptionObject(Node raisingNode, Object exc) {
237233
throw raiseExceptionObject(raisingNode, exc, PythonOptions.isPExceptionWithJavaStacktrace(PythonLanguage.get(raisingNode)));
238234
}

0 commit comments

Comments
 (0)