Euphoria
Ticket #226:
function with if statement and no return crashes
-
Reported by
euphoric
Oct 10, 2010
A function with no return causes a machine-level exception crash instead of a nice error message.
function tester( integer i )
if i = 0 then
?i
else
?i
return 1
end if
end function
?tester( 0 )
Details
1. Comment by mattlewis
Oct 11, 2010
This appears to be an inlining problem.
2. Comment by mattlewis
Oct 11, 2010
We were removing BADRETURNFs from functions and procedures. When a goto target was aiming at the BADRETURNF, removing it would change the goto to a bad address, causing a machine crash.