Skip to content

Commit

Permalink
Properly reset StringPool
Browse files Browse the repository at this point in the history
  • Loading branch information
JothamWong committed Apr 7, 2024
1 parent 1996e95 commit aa67c70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/vm/oogavm-heap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function constructHeap(numWords: number, updateRootsFn): DataView {
free = 0;
allocateLiteralValues();
updateRoots = updateRootsFn;
StringPool.clear();
return heap;
}

Expand Down
5 changes: 3 additions & 2 deletions src/vm/oogavm-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,9 @@ export function run(numWords = 1000000) {
throw Error('execution aborted due to: ' + getErrorType());
}
}
log("Program value is " + addressToTSValue(peekStack(OS[0])));
return addressToTSValue(peekStack(OS[0]));
const returnValue = addressToTSValue(peekStack(OS[0]));
log("Program value is " + returnValue);
return returnValue;
}

function getErrorType(): string {
Expand Down

0 comments on commit aa67c70

Please sign in to comment.