Skip to content

Commit

Permalink
Change order of restoring removed heap objects
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTipson committed Mar 11, 2024
1 parent 52121c3 commit 723bd3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stgmachine/heap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export class heap {
this.added[this.step] = [];
}
if (this.removed[this.step]) {
for (let [addr, obj] of this.removed[this.step]) {
for (let i = this.removed[this.step].length - 1; i >= 0; i--) {
let [addr, obj] = this.removed[this.step][i];
this.current[addr] = obj;
}
this.removed[this.step] = [];
Expand Down

0 comments on commit 723bd3b

Please sign in to comment.