From 01624e8ca736409934015f0740d4c41b0e134786 Mon Sep 17 00:00:00 2001 From: TB Schardl Date: Thu, 27 Nov 2025 14:08:37 -0500 Subject: [PATCH] [cilksan] Add hooks for cxa_throw and exit. --- cilksan/libhooks.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cilksan/libhooks.cpp b/cilksan/libhooks.cpp index 8a5940d..451aa60 100644 --- a/cilksan/libhooks.cpp +++ b/cilksan/libhooks.cpp @@ -855,6 +855,22 @@ __csan___cxa_atexit(const csi_id_t call_id, const csi_id_t func_id, MAAPs.pop(); } +CILKSAN_API void __csan___cxa_throw(const csi_id_t call_id, + const csi_id_t func_id, unsigned MAAP_count, + const call_prop_t prop, + void *thrown_exception, + std::type_info *tinfo, + void (*dest)(void *)) { + if (!CILKSAN_INITIALIZED) + return; + + if (!should_check()) + return; + + for (unsigned i = 0; i < MAAP_count; ++i) + MAAPs.pop(); +} + CILKSAN_API void __csan___isoc99_scanf(const csi_id_t call_id, const csi_id_t func_id, unsigned MAAP_count, @@ -1469,6 +1485,12 @@ CILKSAN_API void __csan_execvpe(const csi_id_t call_id, const csi_id_t func_id, check_read_bytes(call_id, filename_MAAPVal, filename, strlen(filename) + 1); } +CILKSAN_API void __csan_exit(const csi_id_t call_id, const csi_id_t func_id, + unsigned MAAP_count, const call_prop_t prop, + int exit_code) { + return; +} + CILKSAN_API void __csan_expf(const csi_id_t call_id, const csi_id_t func_id, unsigned MAAP_count, const call_prop_t prop, float result, float arg) {