summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-01-28 22:35:48 +0000
committerLang Hames <lhames@gmail.com>2016-01-28 22:35:48 +0000
commit2d8a2aa60a941b23453151da3bd6650e46c0bbf6 (patch)
treeb24024a599b2da1a49e8b7adc460b5cffc0a7ab9 /llvm/lib
parent56d207331972f4eb3d0d9fd971d2e80a6c6d771d (diff)
downloadbcm5719-llvm-2d8a2aa60a941b23453151da3bd6650e46c0bbf6.tar.gz
bcm5719-llvm-2d8a2aa60a941b23453151da3bd6650e46c0bbf6.zip
[RuntimeDyld][MachO] Fix handling of empty eh-frame sections.
This patch switches from an unguarded to a guarded loop for eh-frame record fixups. In the unguarded version we would always make at least one call to processFDE, which would then crash trying to fix up a frame that didn't exist. Fixes <rdar://problem/24301582> llvm-svn: 259103
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 739e8d65dbf..96d6fcbcf4c 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -302,9 +302,9 @@ void RuntimeDyldMachOCRTPBase<Impl>::registerEHFrames() {
uint8_t *P = EHFrame->getAddress();
uint8_t *End = P + EHFrame->getSize();
- do {
+ while (P != End) {
P = processFDE(P, DeltaForText, DeltaForEH);
- } while (P != End);
+ }
MemMgr.registerEHFrames(EHFrame->getAddress(), EHFrame->getLoadAddress(),
EHFrame->getSize());
OpenPOWER on IntegriCloud