[cfe-commits] [libcxxabi] r167733 - /libcxxabi/trunk/src/cxa_personality.cpp

Howard Hinnant hhinnant at apple.com
Mon Nov 12 10:19:15 PST 2012


Author: hhinnant
Date: Mon Nov 12 12:19:15 2012
New Revision: 167733

URL: http://llvm.org/viewvc/llvm-project?rev=167733&view=rev
Log:
Wen-Han Gu:  Fix for http://llvm.org/bugs/show_bug.cgi?id=14312 Exception Table out-of-range but still keep walking.

Modified:
    libcxxabi/trunk/src/cxa_personality.cpp

Modified: libcxxabi/trunk/src/cxa_personality.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_personality.cpp?rev=167733&r1=167732&r2=167733&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_personality.cpp (original)
+++ libcxxabi/trunk/src/cxa_personality.cpp Mon Nov 12 12:19:15 2012
@@ -552,7 +552,7 @@
     const uint8_t* callSiteTableEnd = callSiteTableStart + callSiteTableLength;
     const uint8_t* actionTableStart = callSiteTableEnd;
     const uint8_t* callSitePtr = callSiteTableStart;
-    while (true)
+    while (callSitePtr < callSiteTableEnd)
     {
         // There is one entry per call site.
 #if !__arm__
@@ -782,7 +782,11 @@
             call_terminate(native_exception, unwind_exception);
         }
 #endif  // !__arm__
-    }  // there is no break out of this loop, only return
+    }  // there might be some tricky cases which break out of this loop
+
+    // It is possible that no eh table entry specify how to handle
+    // this exception. By spec, terminate it immediately.
+    call_terminate(native_exception, unwind_exception);
 }
 
 // public API





More information about the cfe-commits mailing list