Improve logic for diverging procedures by checking if it terminates

This commit is contained in:
gingerBill
2021-06-16 12:07:24 +01:00
parent 8f57bb0799
commit 41f2539484
3 changed files with 31 additions and 11 deletions

View File

@@ -255,7 +255,7 @@ Source_Code_Location :: struct {
procedure: string,
}
Assertion_Failure_Proc :: #type proc(prefix, message: string, loc: Source_Code_Location);
Assertion_Failure_Proc :: #type proc(prefix, message: string, loc: Source_Code_Location) -> !;
// Allocation Stuff
Allocator_Mode :: enum byte {
@@ -483,7 +483,7 @@ __init_context :: proc "contextless" (c: ^Context) {
c.logger.data = nil;
}
default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code_Location) {
default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code_Location) -> ! {
print_caller_location(loc);
print_string(" ");
print_string(prefix);
@@ -492,6 +492,6 @@ default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code
print_string(message);
}
print_byte('\n');
debug_trap();
// trap();
// debug_trap();
trap();
}