[libcxxabi] r206122 - Properly sign extend sdata2/4 in unwinder. Patch by Patrick Wildt

Nick Kledzik kledzik at apple.com
Sat Apr 12 16:22:53 PDT 2014


Author: kledzik
Date: Sat Apr 12 18:22:52 2014
New Revision: 206122

URL: http://llvm.org/viewvc/llvm-project?rev=206122&view=rev
Log:
Properly sign extend sdata2/4 in unwinder.  Patch by Patrick Wildt

Modified:
    libcxxabi/trunk/src/Unwind/AddressSpace.hpp

Modified: libcxxabi/trunk/src/Unwind/AddressSpace.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/AddressSpace.hpp?rev=206122&r1=206121&r2=206122&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/AddressSpace.hpp (original)
+++ libcxxabi/trunk/src/Unwind/AddressSpace.hpp Sat Apr 12 18:22:52 2014
@@ -196,12 +196,14 @@ inline LocalAddressSpace::pint_t LocalAd
     result = (pint_t)getSLEB128(addr, end);
     break;
   case DW_EH_PE_sdata2:
-    result = (uint16_t)get16(addr);
+    // Sign extend from signed 16-bit value.
+    result = (int16_t)get16(addr);
     p += 2;
     addr = (pint_t) p;
     break;
   case DW_EH_PE_sdata4:
-    result = (uint32_t)get32(addr);
+    // Sign extend from signed 32-bit value.
+    result = (int32_t)get32(addr);
     p += 4;
     addr = (pint_t) p;
     break;





More information about the cfe-commits mailing list