diff options
| author | 2026-10-14 19:36:30 +0330 | |
|---|---|---|
| committer | 2026-10-14 19:36:30 +0330 | |
| commit | 7e9abb014169b77cba5174ae92ddc3d1eca4d667 (patch) | |
| tree | b7a9b0dd17c1c9fea7b94f9ba7ad115bf2f7470b /src/js/tinyvm.ts | |
| parent | merge work/bench: make bench, bench-check, bench-selftest; baseline at 89f35bd (diff) | |
| parent | rt: exact-size heap bounds; n, the words new asked for, lives in bits 32..62 ... (diff) | |
merge work/exactsize: exact-size heap bounds
Diffstat (limited to 'src/js/tinyvm.ts')
| -rw-r--r-- | src/js/tinyvm.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/tinyvm.ts b/src/js/tinyvm.ts index f52d4af..51b390b 100644 --- a/src/js/tinyvm.ts +++ b/src/js/tinyvm.ts @@ -344,7 +344,7 @@ export class TinyVM { this.mem[block + 2] = this.mem[block + 5] = this.mem[block + 6] = 0n; continue; } const pointer = block + 5; - this.mem[block] = BigInt(2 ** k); this.mem[block + 1] = BigInt(k * 65536 + 1537 + (this.stackGet(16) ? 2 : 0)); + this.mem[block] = BigInt(2 ** k); this.mem[block + 1] = BigInt(k * 65536 + 1537 + (this.stackGet(16) ? 2 : 0)) + (BigInt(words) << 32n); // n, as rt.zc's new_raw this.mem[block + 2] = BigInt(pointer) ^ 0x2B7E1516n; this.mem[block + 3] = 0n; this.mem[block + 4] = -BigInt(words) - 1n; this.mem.fill(0n, pointer, block + 2 ** k); return pointer; |
