aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js')
-rw-r--r--src/js/tinyvm.ts2
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;