From cb3997d8c9089289bbc08dc82cb404149b94165f Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Tue, 10 Mar 2020 15:37:33 +0100 Subject: [PATCH] Fix org location being undefined when incorrect --- src/asm/asmy.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/asm/asmy.y b/src/asm/asmy.y index d453b8cb..682161a4 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -1443,10 +1443,12 @@ sectiontype : T_SECT_WRAM0 { $$ = SECTTYPE_WRAM0; } sectorg : { $$ = -1; } | '[' uconst ']' { - if ($2 < 0 || $2 >= 0x10000) + if ($2 < 0 || $2 >= 0x10000) { yyerror("Address $%x is not 16-bit", $2); - else + $$ = -1; + } else { $$ = $2; + } } ;