diff -Nur libcxxabi-3.7.0.src.orig/src/cxa_default_handlers.cpp libcxxabi-3.7.0.src/src/cxa_default_handlers.cpp
--- libcxxabi-3.7.0.src.orig/src/cxa_default_handlers.cpp	2014-10-04 05:03:47.000000000 +0900
+++ libcxxabi-3.7.0.src/src/cxa_default_handlers.cpp	2018-01-22 17:58:08.000000000 +0900
@@ -35,13 +35,10 @@
         {
             _Unwind_Exception* unwind_exception =
                 reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
-            bool native_exception =
-                (unwind_exception->exception_class   & get_vendor_and_language) == 
-                                 (kOurExceptionClass & get_vendor_and_language);
-            if (native_exception)
+            if (__isOurExceptionClass(unwind_exception))
             {
                 void* thrown_object =
-                    unwind_exception->exception_class == kOurDependentExceptionClass ?
+                    __getExceptionClass(unwind_exception) == kOurDependentExceptionClass ?
                         ((__cxa_dependent_exception*)exception_header)->primaryException :
                         exception_header + 1;
                 const __shim_type_info* thrown_type =
diff -Nur libcxxabi-3.7.0.src.orig/src/cxa_exception.cpp libcxxabi-3.7.0.src/src/cxa_exception.cpp
--- libcxxabi-3.7.0.src.orig/src/cxa_exception.cpp	2015-06-02 22:03:17.000000000 +0900
+++ libcxxabi-3.7.0.src/src/cxa_exception.cpp	2018-01-22 17:58:08.000000000 +0900
@@ -76,22 +76,37 @@
     return size + sizeof (__cxa_exception);
 }
 
-static void setExceptionClass(_Unwind_Exception* unwind_exception) {
-    unwind_exception->exception_class = kOurExceptionClass;
+void __setExceptionClass(_Unwind_Exception* unwind_exception, uint64_t newValue) {
+	::memcpy(&unwind_exception->exception_class, &newValue, sizeof(newValue));
+	}
+	
+
+static void setOurExceptionClass(_Unwind_Exception* unwind_exception) {
+    __setExceptionClass(unwind_exception, kOurExceptionClass);
 }
 
 static void setDependentExceptionClass(_Unwind_Exception* unwind_exception) {
-    unwind_exception->exception_class = kOurDependentExceptionClass;
+    __setExceptionClass(unwind_exception, kOurDependentExceptionClass);
 }
 
 //  Is it one of ours?
-static bool isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
-    return (unwind_exception->exception_class & get_vendor_and_language) == 
-           (kOurExceptionClass                & get_vendor_and_language);
+uint64_t __getExceptionClass(const _Unwind_Exception* unwind_exception) {
+//	On x86 and some ARM unwinders, unwind_exception->exception_class is
+//		a uint64_t. On other ARM unwinders, it is a char[8]
+//	See: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf
+//	So we just copy it into a uint64_t to be sure.
+	uint64_t exClass;
+	::memcpy(&exClass, &unwind_exception->exception_class, sizeof(exClass));
+	return exClass;
+}
+
+bool __isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
+    return (__getExceptionClass(unwind_exception) & get_vendor_and_language) == 
+           (kOurExceptionClass                    & get_vendor_and_language);
 }
 
 static bool isDependentException(_Unwind_Exception* unwind_exception) {
-    return (unwind_exception->exception_class & 0xFF) == 0x01;
+    return (__getExceptionClass(unwind_exception) & 0xFF) == 0x01;
 }
 
 //  This does not need to be atomic
@@ -229,7 +244,7 @@
     exception_header->terminateHandler  = std::get_terminate();
     exception_header->exceptionType = tinfo;
     exception_header->exceptionDestructor = dest;
-    setExceptionClass(&exception_header->unwindHeader);
+    setOurExceptionClass(&exception_header->unwindHeader);
     exception_header->referenceCount = 1;  // This is a newly allocated exception, no need for thread safety.
     globals->uncaughtExceptions += 1;   // Not atomically, since globals are thread-local
 
@@ -278,7 +293,7 @@
     __cxa_exception* exception_header =
         cxa_exception_from_exception_unwind_exception(unwind_exception);
 
-    if (isOurExceptionClass(unwind_exception))
+    if (__isOurExceptionClass(unwind_exception))
     {
         if (0 == exception_header->propagationCount)
         {
@@ -321,7 +336,7 @@
         std::terminate();
     }
 
-    if (isOurExceptionClass(&exception_header->unwindHeader))
+    if (__isOurExceptionClass(&exception_header->unwindHeader))
     {
         --exception_header->propagationCount;
         if (0 == exception_header->propagationCount)
@@ -386,7 +401,7 @@
 __cxa_begin_catch(void* unwind_arg) throw()
 {
     _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg);
-    bool native_exception = isOurExceptionClass(unwind_exception);
+    bool native_exception = __isOurExceptionClass(unwind_exception);
     __cxa_eh_globals* globals = __cxa_get_globals();
     // exception_header is a hackish offset from a foreign exception, but it
     //   works as long as we're careful not to try to access any __cxa_exception
@@ -463,7 +478,7 @@
     //    nothing more to be done.  Do nothing!
     if (NULL != exception_header)
     {
-        bool native_exception = isOurExceptionClass(&exception_header->unwindHeader);
+        bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
         if (native_exception)
         {
             // This is a native exception
@@ -528,7 +543,7 @@
     __cxa_exception *exception_header = globals->caughtExceptions;
     if (NULL == exception_header)
         return NULL;        //  No current exception
-    if (!isOurExceptionClass(&exception_header->unwindHeader))
+    if (!__isOurExceptionClass(&exception_header->unwindHeader))
         return NULL;
     return exception_header->exceptionType;
 }
@@ -553,7 +568,7 @@
     __cxa_exception* exception_header = globals->caughtExceptions;
     if (NULL == exception_header)
         std::terminate();      // throw; called outside of a exception handler
-    bool native_exception = isOurExceptionClass(&exception_header->unwindHeader);
+    bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
     if (native_exception)
     {
         //  Mark the exception as being rethrown (reverse the effects of __cxa_begin_catch)
@@ -646,7 +661,7 @@
     __cxa_exception* exception_header = globals->caughtExceptions;
     if (NULL == exception_header)
         return NULL;        //  No current exception
-    if (!isOurExceptionClass(&exception_header->unwindHeader))
+    if (!__isOurExceptionClass(&exception_header->unwindHeader))
         return NULL;        // Can't capture a foreign exception (no way to refcount it)
     if (isDependentException(&exception_header->unwindHeader)) {
         __cxa_dependent_exception* dep_exception_header =
diff -Nur libcxxabi-3.7.0.src.orig/src/cxa_exception.hpp libcxxabi-3.7.0.src/src/cxa_exception.hpp
--- libcxxabi-3.7.0.src.orig/src/cxa_exception.hpp	2015-02-06 08:48:06.000000000 +0900
+++ libcxxabi-3.7.0.src/src/cxa_exception.hpp	2018-01-22 17:58:08.000000000 +0900
@@ -26,6 +26,10 @@
 static const uint64_t kOurDependentExceptionClass = 0x434C4E47432B2B01; // CLNGC++\1
 static const uint64_t get_vendor_and_language     = 0xFFFFFFFFFFFFFF00; // mask for CLNGC++
 
+uint64_t __getExceptionClass  (const _Unwind_Exception*);
+void     __setExceptionClass  (      _Unwind_Exception*, uint64_t);
+bool     __isOurExceptionClass(const _Unwind_Exception*);
+
 struct __cxa_exception {
 #if defined(__LP64__) || LIBCXXABI_ARM_EHABI
     // This is a new field to support C++ 0x exception_ptr.
diff -Nur libcxxabi-3.7.0.src.orig/src/cxa_handlers.cpp libcxxabi-3.7.0.src/src/cxa_handlers.cpp
--- libcxxabi-3.7.0.src.orig/src/cxa_handlers.cpp	2015-04-16 00:35:56.000000000 +0900
+++ libcxxabi-3.7.0.src/src/cxa_handlers.cpp	2018-01-22 17:58:08.000000000 +0900
@@ -92,10 +92,7 @@
         {
             _Unwind_Exception* unwind_exception =
                 reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
-            bool native_exception =
-                (unwind_exception->exception_class & get_vendor_and_language) ==
-                               (kOurExceptionClass & get_vendor_and_language);
-            if (native_exception)
+            if (__isOurExceptionClass(unwind_exception))
                 __terminate(exception_header->terminateHandler);
         }
     }
diff -Nur libcxxabi-3.7.0.src.orig/src/cxa_personality.cpp libcxxabi-3.7.0.src/src/cxa_personality.cpp
--- libcxxabi-3.7.0.src.orig/src/cxa_personality.cpp	2015-07-12 23:47:53.000000000 +0900
+++ libcxxabi-3.7.0.src/src/cxa_personality.cpp	2018-01-22 17:58:08.000000000 +0900
@@ -486,7 +486,7 @@
     // Even for foreign exceptions, the exception object is *probably* at unwind_exception + 1
     //    Regardless, this library is prohibited from touching a foreign exception
     void* adjustedPtr = unwind_exception + 1;
-    if (unwind_exception->exception_class == kOurDependentExceptionClass)
+    if (__getExceptionClass(unwind_exception) == kOurDependentExceptionClass)
         adjustedPtr = ((__cxa_dependent_exception*)adjustedPtr - 1)->primaryException;
     return adjustedPtr;
 }
@@ -1064,8 +1064,7 @@
     if (unwind_exception == 0 || context == 0)
         return _URC_FATAL_PHASE1_ERROR;
 
-    bool native_exception = (unwind_exception->exception_class & get_vendor_and_language) ==
-                            (kOurExceptionClass & get_vendor_and_language);
+    bool native_exception = __isOurExceptionClass(unwind_exception);
 
 #if !LIBCXXABI_USE_LLVM_UNWINDER
     // Copy the address of _Unwind_Control_Block to r12 so that
@@ -1169,9 +1168,7 @@
     if (unwind_exception == 0)
         call_terminate(false, unwind_exception);
     __cxa_begin_catch(unwind_exception);
-    bool native_old_exception =
-        (unwind_exception->exception_class & get_vendor_and_language) ==
-        (kOurExceptionClass                & get_vendor_and_language);
+    bool native_old_exception = __isOurExceptionClass(unwind_exception);
     std::unexpected_handler u_handler;
     std::terminate_handler t_handler;
     __cxa_exception* old_exception_header = 0;
@@ -1233,16 +1230,14 @@
             if (new_exception_header == 0)
                 // This shouldn't be able to happen!
                 std::__terminate(t_handler);
-            bool native_new_exception =
-                (new_exception_header->unwindHeader.exception_class & get_vendor_and_language) ==
-                                                (kOurExceptionClass & get_vendor_and_language);
+            bool native_new_exception = __isOurExceptionClass(&new_exception_header->unwindHeader);
             void* adjustedPtr;
             if (native_new_exception && (new_exception_header != old_exception_header))
             {
                 const __shim_type_info* excpType =
                     static_cast<const __shim_type_info*>(new_exception_header->exceptionType);
                 adjustedPtr =
-                    new_exception_header->unwindHeader.exception_class == kOurDependentExceptionClass ?
+                    __getExceptionClass(&new_exception_header->unwindHeader) == kOurDependentExceptionClass ?
                         ((__cxa_dependent_exception*)new_exception_header)->primaryException :
                         new_exception_header + 1;
                 if (!exception_spec_can_catch(ttypeIndex, classInfo, ttypeEncoding,
