From acf5b6e284a848e0e7a7b283bc5b57a08afb3b72 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 15 Mar 2026 13:42:56 +0000 Subject: [PATCH] Handle failed def lookup in action_data() --- asm.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/asm.js b/asm.js index 9fce033..38fe606 100644 --- a/asm.js +++ b/asm.js @@ -1009,9 +1009,16 @@ export class Assembler { action_data(action) { const data = this.data.at(-1).data; - const value = action.value != null - ? action.value - : this.le(this.lookup_def(action.symbol), action.size); + let value = action.value; + if (value == undefined) { + 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); this.pos.addr += action.size; }