Skip to content

Commit 9476d94

Browse files
committed
Do not escape frame just for exception type.
1 parent d21d8d8 commit 9476d94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,11 @@ public Object run(Object module,
629629
abstract static class PyErrOccurred extends PythonUnaryBuiltinNode {
630630
@Specialization
631631
Object run(Object errorMarker,
632-
@Cached GetClassNode getClass) {
632+
@Cached GetClassNode getClassNode) {
633633
PException currentException = getContext().getCurrentException();
634634
if (currentException != null) {
635-
PBaseException exceptionObject = currentException.getEscapedException();
636-
return getClass.execute(exceptionObject);
635+
// getClassNode acts as a branch profile
636+
return getClassNode.execute(currentException.getExceptionObject());
637637
}
638638
return errorMarker;
639639
}

0 commit comments

Comments
 (0)