This commit is contained in:
Lucas Perlind
2025-05-07 11:30:58 +10:00
parent fd05f55691
commit 46e0c7ad74
2 changed files with 9 additions and 15 deletions
+1 -3
View File
@@ -1107,11 +1107,9 @@ __read_bits :: proc "contextless" (dst, src: [^]byte, offset: uintptr, size: uin
} }
} }
@(no_sanitize_address) when .Address in ODIN_SANITIZER_FLAGS {
__asan_unpoison_memory_region :: #force_inline proc "contextless" (address: rawptr, size: uint) {
foreign { foreign {
__asan_unpoison_memory_region :: proc "system" (address: rawptr, size: uint) --- __asan_unpoison_memory_region :: proc "system" (address: rawptr, size: uint) ---
} }
__asan_unpoison_memory_region(address, size)
} }
-4
View File
@@ -2918,7 +2918,6 @@ gb_internal void lb_emit_defer_stmts(lbProcedure *p, lbDeferExitKind kind, lbBlo
defer (p->branch_location_pos = prev_token_pos); defer (p->branch_location_pos = prev_token_pos);
// TODO(lucas): In LLVM 21 use the 'use-after-scope' asan option which does this for us. // TODO(lucas): In LLVM 21 use the 'use-after-scope' asan option which does this for us.
#if LLVM_VERSION_MAJOR < 21
if (kind == lbDeferExit_Return) { if (kind == lbDeferExit_Return) {
for_array(i, p->asan_stack_locals) { for_array(i, p->asan_stack_locals) {
lbValue local = p->asan_stack_locals[i]; lbValue local = p->asan_stack_locals[i];
@@ -2929,9 +2928,6 @@ gb_internal void lb_emit_defer_stmts(lbProcedure *p, lbDeferExitKind kind, lbBlo
lb_emit_runtime_call(p, "__asan_unpoison_memory_region", args); lb_emit_runtime_call(p, "__asan_unpoison_memory_region", args);
} }
} }
#else
#error "Need to implement LLVM 21 'use-after-scope' asan option"
#endif
isize count = p->defer_stmts.count; isize count = p->defer_stmts.count;
isize i = count; isize i = count;