Don't deference the section_end() iterator.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 17 Feb 2015 20:07:28 +0000 (20:07 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 17 Feb 2015 20:07:28 +0000 (20:07 +0000)
Hard to test given the undefined behavior nature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229530 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

index fb53ba96055cdc1d7757a36f792e094aab5b7935..54f1a1c0cc2d35aef3da97ead73871bb1390f993 100644 (file)
@@ -214,6 +214,9 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
     StubMap Stubs;
     section_iterator RelocatedSection = SI->getRelocatedSection();
 
+    if (RelocatedSection == SE)
+      continue;
+
     relocation_iterator I = SI->relocation_begin();
     relocation_iterator E = SI->relocation_end();