You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at 'Interpreter error: Code address 0002 out of bounds (0..2)', src/main.rs:141:14
It works fine if the implicit global function contains anything else - e.g. just null.
Version 1 doesn't crash.
My compiler+interpreter has pretty much the same bug - there are 2 causes:
With an empty input file, the parser returns a Top which contains a Null node so there's 1 instruction in the generated code. With a file that contains a function but nothing else, the parser returns a Top which contains the function but no other nodes so the implicit global function ends up having 0 instructions.
My interpreter first gets the instruction from the code vector (this is the index out of bounds), executes it, then breaks the loop if the instruction pointer has jumped out of the code vector. Moving this check to the start of the loop fixes the crash for me, maybe your interpreter does something similar.
The text was updated successfully, but these errors were encountered:
Example .fml file:
Error (using the
run
command):It works fine if the implicit global function contains anything else - e.g. just
null
.Version 1 doesn't crash.
My compiler+interpreter has pretty much the same bug - there are 2 causes:
Top
which contains aNull
node so there's 1 instruction in the generated code. With a file that contains a function but nothing else, the parser returns aTop
which contains the function but no other nodes so the implicit global function ends up having 0 instructions.The text was updated successfully, but these errors were encountered: