LEB128-encode values from defs
This commit is contained in:
7
asm.js
7
asm.js
@@ -750,13 +750,18 @@ export class Assembler {
|
||||
?? this.lookup_param(func, action.symbol)
|
||||
?? this.lookup_local(func, action.symbol)
|
||||
?? this.lookup_global(action.symbol)
|
||||
?? this.lookup_def(action.symbol);
|
||||
if (value == null) {
|
||||
const def_value = this.lookup_def(action.symbol);
|
||||
if (def_value == null) {
|
||||
console.error(
|
||||
`ERROR: Unable to resolve symbol ${action.symbol}`);
|
||||
return;
|
||||
}
|
||||
func.body.push(...this.leb128(def_value));
|
||||
} else {
|
||||
func.body.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
action_mem(action) {
|
||||
Object.assign(this.mems, action.mem);
|
||||
|
||||
Reference in New Issue
Block a user