jserv / amacc

Small C Compiler generating ELF executable Arm architecture, supporting JIT execution
Other
1.01k stars 160 forks source link

Incorrect execution result for simple program #60

Closed jserv closed 4 years ago

jserv commented 4 years ago

maze.c.gz is a simple maze generator written by Joe Wingbermuehle. The modified program can be parsed and executed by AMaCC. However, the program output is NOT correct. It was assumed to be kind of maze though. Also, the functionality to solve maze was incorrect.

jserv commented 4 years ago

After applying the potential fix #61 against modulo operator and replacing all occurrences of % with mod call, program maze.c is known to work.

$ /usr/bin/qemu-arm -L /usr/arm-linux-gnueabihf ./amacc  maze.c
[]  [][][][][][][][][][][][][][][][][][][][][]
[]      []              []                  []
[][][]  [][][]  []  [][][]  [][][][][]  []  []
[]          []  []          []      []  []  []
[]  [][][]  []  [][][][][]  []  []  [][][]  []
[]  []      []          []  []  []      []  []
[]  []  [][][][][][][]  [][][]  []  []  []  []
[]  []                  []      []  []      []
[]  [][][][][][][][][][][]  [][][][][]  [][][]
[]  []                  []  []      []      []
[]  []  [][][][][][][][][]  [][][]  [][][]  []
[]  []                  []      []  []  []  []
[]  [][][][][][][][][]  []  []  []  []  []  []
[]                  []  []  []      []      []
[][][][][][][][][]  []  []  [][][][][][][][][]
[]              []  []  []                  []
[]  [][][][][]  []  []  []  [][][][][][][]  []
[]  []      []  []      []              []  []
[]  [][][]  []  []  [][][][][][][][][]  []  []
[]      []      []      []          []  []  []
[]  []  [][][][][][][][][]  []  []  [][][]  []
[]  []                      []  []          []
[][][][][][][][][][][][][][][][][][][][][]  []
jserv commented 4 years ago

Close via commit 770e4c966dec76d571187d8c310d8ee625aa66bf