Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-59966] Fix duplication of BciBlocks. #10142

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ public BciBlock copy() {
if (block.jsrData != null) {
block.jsrData = block.jsrData.copy();
}
block.successors = new ArrayList<>(successors);
block.successors = new ArrayList<>();
for (var sux : successors) {
block.addSuccessor(sux);
}
block.loops = (BitSet) block.loops.clone();
return block;
} catch (CloneNotSupportedException e) {
Expand All @@ -431,7 +434,10 @@ public BciBlock duplicate() {
if (block.jsrData != null) {
throw new PermanentBailoutException("Can not duplicate block with JSR data");
}
block.successors = new ArrayList<>(successors);
block.successors = new ArrayList<>();
for (var sux : successors) {
block.addSuccessor(sux);
}
block.loops = new BitSet();
block.loopId = 0;
block.id = UNASSIGNED_ID;
Expand Down Expand Up @@ -915,6 +921,7 @@ private void resolveExceptionHandlerReachability() {
blocksNotYetAssignedId++;
}
b.successors.set(i, dup);
dup.predecessorCount++;

if (duplicates.get(b) != null) {
// Patch successor of own duplicate.
Expand Down
Loading