summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s7
2 files changed, 9 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());
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s
new file mode 100644
index 00000000000..d912867b8ec
--- /dev/null
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s
@@ -0,0 +1,7 @@
+# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %T/empty_eh_frame.o %s
+# RUN: llvm-rtdyld -verify -triple=x86_64-apple-macosx10.9 %T/empty_eh_frame.o
+
+ .section __TEXT,__eh_frame
+ .macosx_version_min 10, 10
+
+.subsections_via_symbols
OpenPOWER on IntegriCloud