path: root/src/pal/src/exception/seh-unwind.cpp
diff options
authorJan Vorlicek <>2015-03-14 01:06:14 +0100
committerJan Vorlicek <>2015-03-16 23:08:48 +0100
commit0564f1771d87258e8ceba425e1e25efaea0bacc1 (patch)
tree4b79c178e48b87fdaf3b0cf6bb2222737c1a99fa /src/pal/src/exception/seh-unwind.cpp
parent896d3d1c3d192a889410311cd3a5dd879d09dc8d (diff)
Make GC work without context pointers on OSX
On OSX, the libunwind doesn't have support for getting context pointers. This change modifies the way GC handles object pointers in registers so that when the context pointer cannot be obtained, the object is pinned so that GC doesn't move it and thus doesn't need to update the object reference in the register value stored on the stack.
Diffstat (limited to 'src/pal/src/exception/seh-unwind.cpp')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index 98c7f0b5c2..6a547979b1 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -91,7 +91,8 @@ static void UnwindContextToWinContext(unw_cursor_t *cursor, CONTEXT *winContext)
static void GetContextPointer(unw_cursor_t *cursor, unw_context_t *unwContext, int reg, PDWORD64 *contextPointer)
#if defined(__APPLE__)
+ // Returning NULL indicates that we don't have context pointers available
+ *contextPointer = NULL;
unw_save_loc_t saveLoc;
unw_get_save_loc(cursor, reg, &saveLoc);