about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-07 11:44:34 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-11 17:31:38 -0700
commit9f4b4d89cee40a04bf4b3227e378588e438e588a (patch)
tree638eed1111f55f5776bbe83f97ed8710a6fb6adc /src/rt/rust_upcall.cpp
parentf1e348ce6ae8b80bcb3ffd81934d82dbdddc7647 (diff)
downloadrust-9f4b4d89cee40a04bf4b3227e378588e438e588a.tar.gz
rust-9f4b4d89cee40a04bf4b3227e378588e438e588a.zip
Add upcall_rust_personality
This just wraps __gxx_personality_v0 with our upcall naming convention

Issue #236
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 2d7791e876f..0f5c11537fe 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -1,6 +1,8 @@
 #include "rust_gc.h"
 #include "rust_internal.h"
 #include "rust_upcall.h"
+#include <stdint.h>
+#include <unwind.h>
 
 // Upcalls.
 
@@ -190,6 +192,26 @@ upcall_dynastack_free(rust_task *task, void *ptr) {
     return task->dynastack.free(ptr);
 }
 
+extern "C" _Unwind_Reason_Code
+__gxx_personality_v0(int version,
+                     _Unwind_Action actions,
+                     uint64_t exception_class,
+                     _Unwind_Exception *ue_header,
+                     _Unwind_Context *context);
+
+extern "C" _Unwind_Reason_Code
+upcall_rust_personality(int version,
+                        _Unwind_Action actions,
+                        uint64_t exception_class,
+                        _Unwind_Exception *ue_header,
+                        _Unwind_Context *context) {
+    return __gxx_personality_v0(version,
+                                actions,
+                                exception_class,
+                                ue_header,
+                                context);
+}
+
 //
 // Local Variables:
 // mode: C++