Added code for handling shr/shl operators in LiteralAnalyser. The previous default made them return a 1 bit result :(
Added warnings for lhs < 0, rhs < 0, and shift where shift was wider than lhs bit width.
Should probably add warning for lhs overflow too. But that requires a discussion. Added tests, one to reproduce the problem, three for the warnings.
I also added a missing include for when C2Parser has debug on.
Minor refactoring: since getting lhs/rhs was common, I extracted those values into locals.
Added code for handling shr/shl operators in LiteralAnalyser. The previous default made them return a 1 bit result :(
Added warnings for lhs < 0, rhs < 0, and shift where shift was wider than lhs bit width. Should probably add warning for lhs overflow too. But that requires a discussion. Added tests, one to reproduce the problem, three for the warnings.
I also added a missing include for when C2Parser has debug on.
Minor refactoring: since getting lhs/rhs was common, I extracted those values into locals.