mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 19:22:05 +00:00
Define 3-bit value when invalid
This commit is contained in:
@@ -1055,10 +1055,13 @@ endc : T_POP_ENDC {
|
|||||||
|
|
||||||
const_3bit : const {
|
const_3bit : const {
|
||||||
int32_t value = $1;
|
int32_t value = $1;
|
||||||
if ((value < 0) || (value > 7))
|
|
||||||
|
if ((value < 0) || (value > 7)) {
|
||||||
yyerror("Immediate value must be 3-bit");
|
yyerror("Immediate value must be 3-bit");
|
||||||
else
|
$$ = 0;
|
||||||
|
} else {
|
||||||
$$ = value & 0x7;
|
$$ = value & 0x7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user