Fix bug in local lookup
This commit is contained in:
4
asm.js
4
asm.js
@@ -752,8 +752,8 @@ export class Assembler {
|
|||||||
|
|
||||||
lookup_local(func, symbol) {
|
lookup_local(func, symbol) {
|
||||||
const param_count = Object.entries(func.params).length;
|
const param_count = Object.entries(func.params).length;
|
||||||
const index = param_count + Object.keys(func.locals).indexOf(symbol);
|
const index = Object.keys(func.locals).indexOf(symbol);
|
||||||
return index == -1 ? null : index;
|
return index == -1 ? null : param_count + index;
|
||||||
}
|
}
|
||||||
|
|
||||||
lookup_global(symbol) {
|
lookup_global(symbol) {
|
||||||
|
|||||||
Reference in New Issue
Block a user