-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add branch termination check & crashes #97
Open
Description
Add the necessary things in order to make sure that every function ends with a termination statement that follows:
- return statement: Returns a value. Can be suppressed if the block doesn't return anything
- crash statement: Crashes the program instantly, doesn't cleanly unroll values.
- branch jump: Jumps to another branch/block
Furthermore, add MIR checks to make sure that every block ends with a termination statement. This is to guarantee behavior and allow LLVM and other bridges to fully optimize stuff
A crash can be done trough the following:
crash("This program will crash now");
A crash will instantly crash the program and exit it