Wilfred / bfc

An industrial-grade brainfuck compiler
https://bfc.wilfred.me.uk
GNU General Public License v2.0
508 stars 30 forks source link

Spurious warning when compiling mandelbrot #7

Closed Wilfred closed 8 years ago

Wilfred commented 8 years ago
sample_programs/mandelbrot.bf:20:29 warning: This multiply loop tried to access cell -16 (offset -36 from current cell 20)
<]<+<<<<<<<<<]>>>>>>>>>[>>>>[-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wilfred commented 8 years ago

This (and probably #13) too are because we compile [-<++>] to MultiplyMove { changes: { -1: 2 } }. We cannot execute this multiply move if the current cell pointer is 0!

Both execution.rs and llvm.rs will need updating.

Wilfred commented 8 years ago

Fixed.