Skip to content

Commit f70bec8

Browse files
committed
[GR-60256] Source position of LoopEndNode should be source not destination
PullRequest: graal/19558
2 parents d6ddf70 + 312e2df commit f70bec8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BytecodeParser.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,12 @@ private FixedNode createTarget(BciBlock block, FrameStateBuilder state, boolean
34553455
* loop begin node created before.
34563456
*/
34573457
LoopBeginNode loopBegin = (LoopBeginNode) getFirstInstruction(block);
3458-
LoopEndNode loopEnd = graph.add(new LoopEndNode(loopBegin));
3458+
LoopEndNode loopEnd;
3459+
try (DebugCloseable context2 = openNodeContext()) {
3460+
// This is the end up of the current control flow so use a position at source
3461+
// location instead of the destination.
3462+
loopEnd = graph.add(new LoopEndNode(loopBegin));
3463+
}
34593464
Target target = checkUnstructuredLocking(checkLoopExit(new Target(loopEnd, state.copy()), block), block, getEntryState(block));
34603465
FixedNode result = target.entry;
34613466
/*

0 commit comments

Comments
 (0)