Define 3-bit value when invalid

This commit is contained in:
ISSOtm
2020-03-14 16:17:30 +01:00
parent 2f466c2939
commit 6662c86d5e

View File

@@ -1055,10 +1055,13 @@ endc : T_POP_ENDC {
const_3bit : const {
int32_t value = $1;
if ((value < 0) || (value > 7))
if ((value < 0) || (value > 7)) {
yyerror("Immediate value must be 3-bit");
else
$$ = 0;
} else {
$$ = value & 0x7;
}
}
;