From 204eda14fa7d747a549d085ca06904c719d59995 Mon Sep 17 00:00:00 2001 From: stepan Date: Tue, 12 Nov 2024 22:26:05 +0100 Subject: [PATCH] TODO: fix assertion due to wrong location in PException --- .../python/builtins/modules/cext/PythonCextErrBuiltins.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextErrBuiltins.java b/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextErrBuiltins.java index 434c0dbea8..57615a53fe 100644 --- a/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextErrBuiltins.java +++ b/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextErrBuiltins.java @@ -301,6 +301,12 @@ Object run(Object typ, PBaseException val, Object tb) { } } + /*- TODO: this sets as a location in the exception itself, but then we probably call setCatchLocation + once the exception surfaces in the bytecode interpreter making its root node be: PBytecodeDSLRootNode. + However, the Truffle stack filling logic calls PBytecodeDSLRootNodeGen.findBytecodeIndex and that + asserts that the location node is instanceof AbstractBytecodeNode assuming that the location must + come from that root node, which is not true in this situation. What should we do? Fixup the location + of exceptions that surface from other root nodes than us? */ @CApiBuiltin(ret = Void, args = {PyObject, PyObject}, call = Direct) abstract static class _PyTruffleErr_CreateAndSetException extends CApiBinaryBuiltinNode { @Specialization(guards = "!isExceptionClass(inliningTarget, type, isTypeNode, isSubClassNode)")