Fix bug in local lookup

This commit is contained in:
2026-03-14 13:59:29 +00:00
parent e2429b2b03
commit 33f5a4be06

4
asm.js
View File

@@ -752,8 +752,8 @@ export class Assembler {
lookup_local(func, symbol) {
const param_count = Object.entries(func.params).length;
const index = param_count + Object.keys(func.locals).indexOf(symbol);
return index == -1 ? null : index;
const index = Object.keys(func.locals).indexOf(symbol);
return index == -1 ? null : param_count + index;
}
lookup_global(symbol) {