diff options
| author | Nick Kledzik <kledzik@apple.com> | 2014-04-12 23:22:52 +0000 |
|---|---|---|
| committer | Nick Kledzik <kledzik@apple.com> | 2014-04-12 23:22:52 +0000 |
| commit | 0f64d663041c2215aa58ea84d5bb5ea798025fcc (patch) | |
| tree | 6945c27d5fdf22323734f88f72ae869d01f2f0ce | |
| parent | 74ebf587429319d63a87bf069ee5f627923807b5 (diff) | |
| download | bcm5719-llvm-0f64d663041c2215aa58ea84d5bb5ea798025fcc.tar.gz bcm5719-llvm-0f64d663041c2215aa58ea84d5bb5ea798025fcc.zip | |
Properly sign extend sdata2/4 in unwinder. Patch by Patrick Wildt
llvm-svn: 206122
| -rw-r--r-- | libcxxabi/src/Unwind/AddressSpace.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxxabi/src/Unwind/AddressSpace.hpp b/libcxxabi/src/Unwind/AddressSpace.hpp index aac8b7fbd9d..dd58f247156 100644 --- a/libcxxabi/src/Unwind/AddressSpace.hpp +++ b/libcxxabi/src/Unwind/AddressSpace.hpp @@ -196,12 +196,14 @@ inline LocalAddressSpace::pint_t LocalAddressSpace::getEncodedP(pint_t &addr, 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; |

