Native functions break things if their value isn't used
native_function()
for x = 0 to 10
print x
end
prints 0 and then stops. Seems that x gets pointed at the result of the native function call, and then the rest of the stack is messed up. The fix is probably just a missing pop() when the native function expression is treated as a statement.