Support asserts.
For example.
assert x>0
If the condition is false, error report containing the name of source code,
line number and possibly values of variables used in condition will be
displayed and the application stops.
assert <cond>
is compiled as
if not <cond> call assert_print <file><line_no><list of vars>
assert_print is special version of print procedure.
It must setup display so, that the assert message is visible, print the assert
message and then stop execution. It may optionally allow the application to
continue, but that would require restoring the display etc. which may not be
possible.
When compiling release version of the application, assert_print is defined as
void. Optimizer will thus remove all the assert conditionals.
There may also be some special support by debuggers, which may execute the
asserts outside normal execution. Start and end of assert code should be
therefore marked with special instruction.
Original issue reported on code.google.com by rudla.ku...@gmail.com on 31 May 2011 at 4:04
Original issue reported on code.google.com by
rudla.ku...@gmail.com
on 31 May 2011 at 4:04