Skip to content

Commit 4412fa9

Browse files
committed
fix: safeAlloc infinite recursion — called itself instead of exports.alloc
safeAlloc() was calling this.safeAlloc(bytes) instead of this.exports.alloc(bytes), causing infinite recursion and stack overflow on every WASM operation. This broke all 57 call sites: decompression, column registration, fragment building, vector search, IVF-PQ index loading, and every WASM memory allocation path. Not caught by tests because node tests mock WASM and workerd tests use a separate config.
1 parent 251cd33 commit 4412fa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wasm-engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class WasmEngine {
174174
/** Alloc with i32 overflow guard — returns 0 if byte size exceeds WASM i32 range. */
175175
private safeAlloc(bytes: number): number {
176176
if (bytes > 0x7FFF_FFFF) return 0;
177-
return this.safeAlloc(bytes);
177+
return this.exports.alloc(bytes);
178178
}
179179

180180
reset(): void { this.exports.resetResult(); }

0 commit comments

Comments
 (0)