diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-26 18:29:39 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-26 18:29:39 +0000 |
| commit | 96f1069e4a615e0857d9443fe5af639e3b2dd46a (patch) | |
| tree | 411583617f5387490f088a530645547fe5d57131 | |
| parent | 3586bda6ae80b1dca1984ae54b023d5fec69067e (diff) | |
Fix `type_assertion_check2*` for `-no-rtti`
| -rw-r--r-- | base/runtime/error_checks.odin | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/base/runtime/error_checks.odin b/base/runtime/error_checks.odin index 79245fc0c..34f51ab8e 100644 --- a/base/runtime/error_checks.odin +++ b/base/runtime/error_checks.odin @@ -170,11 +170,14 @@ when ODIN_NO_RTTI { return } @(cold, no_instrumentation) - handle_error :: proc "contextless" (file: string, line, column: i32) -> ! { - print_caller_location(Source_Code_Location{file, line, column, ""}) - print_string(" Invalid type assertion\n") - type_assertion_trap() + handle_error :: proc "odin" (file: string, line, column: i32) -> ! { + p := context.assertion_failure_proc + if p == nil { + p = default_assertion_failure_proc + } + p("type assertion", "Invalid type assertion", Source_Code_Location{file, line, column, ""}) } + handle_error(file, line, column) } @@ -183,12 +186,10 @@ when ODIN_NO_RTTI { return } @(cold, no_instrumentation) - handle_error :: proc "odin" (file: string, line, column: i32) -> ! { - p := context.assertion_failure_proc - if p == nil { - p = default_assertion_failure_proc - } - p("type assertion", "Invalid type assertion", Source_Code_Location{file, line, column, ""}) + handle_error :: proc "contextless" (file: string, line, column: i32) -> ! { + print_caller_location(Source_Code_Location{file, line, column, ""}) + print_string(" Invalid type assertion\n") + type_assertion_trap() } handle_error(file, line, column) } |