dreasgrech/yabfcompiler

An issue with loop expansion when the domain after a code walk modifies a negative offset

Opened this issue · 1 comments

I have a problem with the following program:

>>>+++[-[->+<]+>[-<+>>>-[->+<]+><<<]<<<<]

A working compiler ends up with this domain after execution:

[] [] [] [3] [] [] [1] [255]

But after unrolling loops, I end up with:

[] [] [] [3] [] [] [2] [254]

Issue

This problem is not really specific to instances where a negative offset is involved, because my code works fine with a program like this:

+++++[-<++++++>]