Closed Theldus closed 4 years ago
MazuCC produces wrong shifts (i.e: inverted) on integer expressions. Steps to reproduce:
$ echo "int foo = 16<<2; int bar = 16>>2;" > test.c $ ./mzcc test.c .data # emit_data_section:724 .global foo # emit_global_var -> emit_data:694 foo: # emit_global_var -> emit_data:695 .long 4 # emit_global_var -> emit_data -> emit_data_int:681 .global bar # emit_global_var -> emit_data:694 bar: # emit_global_var -> emit_data:695 .long 64 # emit_global_var -> emit_data -> emit_data_int:681
FIx this by inverting the shifts order (left -> right / right -> left) on parser.
Thank @Theldus for spotting this!
MazuCC produces wrong shifts (i.e: inverted) on integer expressions. Steps to reproduce:
FIx this by inverting the shifts order (left -> right / right -> left) on parser.