Skip to content

Commit 6369b79

Browse files
committed
missing TruffleBoundary for Throwable.getMessage()
1 parent b777b04 commit 6369b79

File tree

1 file changed

+9
-3
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement

1 file changed

+9
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/TryExceptNode.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import com.oracle.graal.python.runtime.exception.ExceptionHandledException;
3535
import com.oracle.graal.python.runtime.exception.PException;
3636
import com.oracle.graal.python.runtime.exception.PythonErrorType;
37+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
38+
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
3739
import com.oracle.truffle.api.CompilerDirectives;
3840
import com.oracle.truffle.api.frame.VirtualFrame;
3941
import com.oracle.truffle.api.nodes.ControlFlowException;
@@ -45,7 +47,7 @@ public class TryExceptNode extends StatementNode {
4547
@Children final ExceptNode[] exceptNodes;
4648
@Child private PNode orelse;
4749

48-
@CompilerDirectives.CompilationFinal boolean seenException;
50+
@CompilationFinal boolean seenException;
4951

5052
public TryExceptNode(PNode body, ExceptNode[] exceptNodes, PNode orelse) {
5153
this.body = body;
@@ -70,8 +72,7 @@ public Object execute(VirtualFrame frame) {
7072
if (t instanceof ControlFlowException) {
7173
throw t;
7274
} else {
73-
PBaseException baseException = factory().createBaseException(getCore().getErrorClass(PythonErrorType.ValueError), t.getMessage(), new Object[0]);
74-
PException pe = new PException(baseException, this);
75+
PException pe = new PException(getBaseException(t), this);
7576
try {
7677
catchException(frame, pe);
7778
} catch (PException pe_thrown) {
@@ -87,6 +88,11 @@ public Object execute(VirtualFrame frame) {
8788
return orelse.execute(frame);
8889
}
8990

91+
@TruffleBoundary
92+
private PBaseException getBaseException(Throwable t) {
93+
return factory().createBaseException(getCore().getErrorClass(PythonErrorType.ValueError), t.getMessage(), new Object[0]);
94+
}
95+
9096
@ExplodeLoop
9197
private void catchException(VirtualFrame frame, PException exception) {
9298
boolean wasHandled = false;

0 commit comments

Comments
 (0)