mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Check if integer constants only contain radix prefix
This commit is contained in:
@@ -100,7 +100,13 @@ static int32_t ascii2bin(char *s)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radix == 4) {
|
if (*s == '\0') {
|
||||||
|
/*
|
||||||
|
* There are no digits after the radix prefix
|
||||||
|
* (or the string is empty, which shouldn't happen).
|
||||||
|
*/
|
||||||
|
yyerror("Invalid integer constant");
|
||||||
|
} else if (radix == 4) {
|
||||||
int32_t c;
|
int32_t c;
|
||||||
|
|
||||||
while (*s != '\0') {
|
while (*s != '\0') {
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
ERROR: divzero-section-bank.asm(1):
|
||||||
|
Invalid integer constant
|
||||||
ERROR: divzero-section-bank.asm(1):
|
ERROR: divzero-section-bank.asm(1):
|
||||||
Division by zero
|
Division by zero
|
||||||
|
|||||||
Reference in New Issue
Block a user