Skip to content

Commit

Permalink
Fresh memory at every reset. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw authored Jan 16, 2025
1 parent 44ccfd9 commit d626ea3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assembly/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { decodeProgram, liftBytes } from "./program";
import { NO_OF_REGISTERS, REG_SIZE_BYTES, Registers } from "./registers";

let interpreter: Interpreter | null = null;
const builder = new MemoryBuilder();

export function resetGeneric(program: u8[], flatRegisters: u8[], initialGas: Gas): void {
const p = decodeProgram(liftBytes(program));
Expand All @@ -30,6 +29,7 @@ export function resetGenericWithMemory(
const registers: Registers = new StaticArray(NO_OF_REGISTERS);
fillRegisters(registers, flatRegisters);

const builder = new MemoryBuilder();
const memory = buildMemory(builder, readPages(pageMap), readChunks(chunks));

const int = new Interpreter(p, registers, memory);
Expand Down

0 comments on commit d626ea3

Please sign in to comment.