Handle failed def lookup in action_data()

This commit is contained in:
2026-03-15 13:42:56 +00:00
parent 72c5f64312
commit acf5b6e284

13
asm.js
View File

@@ -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;
} }