shithub: rgbds

Download patch

ref: cb3997d8c9089289bbc08dc82cb404149b94165f
parent: c7320a49a942fc3380f433853c4bbdc640c92737
author: ISSOtm <[email protected]>
date: Tue Mar 10 11:37:33 EDT 2020

Fix org location being undefined when incorrect

--- a/src/asm/asmy.y
+++ b/src/asm/asmy.y
@@ -1443,10 +1443,12 @@
 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;
+			}
 		}
 ;