Handle failed def lookup in action_data()
This commit is contained in:
13
asm.js
13
asm.js
@@ -1009,9 +1009,16 @@ export class Assembler {
|
|||||||
|
|
||||||
action_data(action) {
|
action_data(action) {
|
||||||
const data = this.data.at(-1).data;
|
const data = this.data.at(-1).data;
|
||||||
const value = action.value != null
|
let value = action.value;
|
||||||
? action.value
|
if (value == undefined) {
|
||||||
: this.le(this.lookup_def(action.symbol), action.size);
|
const raw = this.lookup_def(action.symbol);
|
||||||
|
if (raw == undefined) {
|
||||||
|
console.error(
|
||||||
|
`ERROR: Unable to resolve symbol ${action.symbol}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
value = this.le(raw, action.size);
|
||||||
|
}
|
||||||
data.push(...value);
|
data.push(...value);
|
||||||
this.pos.addr += action.size;
|
this.pos.addr += action.size;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user