Fix org location being undefined when incorrect

This commit is contained in:
ISSOtm
2020-03-10 15:37:33 +01:00
parent c7320a49a9
commit cb3997d8c9

View File

@@ -1443,11 +1443,13 @@ sectiontype : T_SECT_WRAM0 { $$ = SECTTYPE_WRAM0; }
sectorg : { $$ = -1; } sectorg : { $$ = -1; }
| '[' uconst ']' | '[' uconst ']'
{ {
if ($2 < 0 || $2 >= 0x10000) if ($2 < 0 || $2 >= 0x10000) {
yyerror("Address $%x is not 16-bit", $2); yyerror("Address $%x is not 16-bit", $2);
else $$ = -1;
} else {
$$ = $2; $$ = $2;
} }
}
; ;
sectattrs : sectattrs :