diff --git a/assembly/api.ts b/assembly/api.ts index 6fed52b..af2b687 100644 --- a/assembly/api.ts +++ b/assembly/api.ts @@ -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)); @@ -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);