From 33f5a4be06683c927573a3428c63b6ce2b07c7d2 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sat, 14 Mar 2026 13:59:29 +0000 Subject: [PATCH] Fix bug in local lookup --- asm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm.js b/asm.js index 4b89ace..cb1de69 100644 --- a/asm.js +++ b/asm.js @@ -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) {