failed assertion.
andrewchambers opened this issue · comments
andrewchambers commented
Using creduce to find bugs in 8cc. First one.
short a;
void fn1() { -a; }
-> 8cc: parse.c:525: usual_arith_conv: Assertion `is_inttype(t) && t->size >= type_int->size' failed.
andrewchambers commented
I think it is unary - not promoting its value with conv, unary minus is done as a binop('-',0,x); where the 0 is the same type as x. This means it attempts to promote x to type short, which fails the assertion above.
andrewchambers commented
addressed in #30. handle it there.