mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fix incorrect val.i64 check
This commit is contained in:
parent
6b8a33d726
commit
9d3354e89e
2
ir.g
2
ir.g
@ -269,7 +269,7 @@ val(ir_parser_ctx *p, uint8_t op, uint32_t n, ir_ref *ref):
|
||||
{*ref = ir_strl(p->ctx, str, len);}
|
||||
| DECNUMBER(IR_I32, &val)
|
||||
{if (kind != IR_OPND_NUM && kind != IR_OPND_PROB) yy_error("unexpected number");}
|
||||
{if (val.i64 < 0 && val.i64 >= 0x7ffffff) yy_error("number out of range");}
|
||||
{if (val.i64 < 0 || val.i64 > 0x7fffffff) yy_error("number out of range");}
|
||||
{*ref = val.u64;}
|
||||
| "null"
|
||||
{*ref = IR_UNUSED;}
|
||||
|
@ -893,7 +893,7 @@ static int parse_val(int sym, ir_parser_ctx *p, uint8_t op, uint32_t n, ir_ref *
|
||||
} else if (sym == YY_DECNUMBER) {
|
||||
sym = parse_DECNUMBER(sym, IR_I32, &val);
|
||||
if (kind != IR_OPND_NUM && kind != IR_OPND_PROB) yy_error("unexpected number");
|
||||
if (val.i64 < 0 && val.i64 >= 0x7ffffff) yy_error("number out of range");
|
||||
if (val.i64 < 0 || val.i64 > 0x7fffffff) yy_error("number out of range");
|
||||
*ref = val.u64;
|
||||
} else if (sym == YY_NULL) {
|
||||
sym = get_sym();
|
||||
|
Loading…
Reference in New Issue
Block a user