Closed alapha23 closed 5 years ago
It seems left shift on negative numbers are not handled properly.
Make check has error message as below:
- 4 << -1 = 0 ? ^ + 4 << -1 = 2 ? ^
I traced the source code and it seemed the negative numbers have not been taken into consideration in our semantics.
At line 618 of amacc.c
case Shl: next(); *++e = PSH; expr(Add); *++e = SHL; ty = INT; break;
So is it a bug or a feature of our compiler? Please do correct me if I missed out something.
Dupilcated by #39
It seems left shift on negative numbers are not handled properly.
Make check has error message as below:
I traced the source code and it seemed the negative numbers have not been taken into consideration in our semantics.
At line 618 of amacc.c
So is it a bug or a feature of our compiler? Please do correct me if I missed out something.