mindcode
mindcode copied to clipboard
Wrong expression handling in loops
The Data Flow Optimizer mishandles loop expression. This code
x = 0
while true
print(x + 1)
x = rand(10)
print(x + 1)
end
compiles into
print __tmp2
op rand x 10 0
op add __tmp2 x 1
print __tmp2
jump 0 always 0 0
and produces (correctly) a warning about the __tmp2
variable being uninitialized.