Skip to content

Commit 3565a1a

Browse files
committed
Fix crash in ExceptionUtils.getLineno on continuation frames
1 parent a5a225e commit 3565a1a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/exception

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/exception/ExceptionUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -136,6 +136,9 @@ private static int getLineno(Frame frame, Node location, FrameInstance frameInst
136136
}
137137

138138
if (bytecodeNode != null) {
139+
if (PGenerator.isGeneratorFrame(frame)) {
140+
frame = PGenerator.getGeneratorFrame(frame);
141+
}
139142
int bci = bytecodeNode.getBytecodeIndex(frame);
140143
SourceSection sourceLocation = bytecodeNode.getBytecodeLocation(bci).getSourceLocation();
141144
if (sourceLocation != null) {

0 commit comments

Comments
 (0)