[PATCH] D38020: [COFF] Adjust secrel limit check

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 17:20:08 PDT 2017


smeenai updated this revision to Diff 115933.
smeenai retitled this revision from "[COFF] Adjust secrel limit assertion" to "[COFF] Adjust secrel limit check".
smeenai edited the summary of this revision.
smeenai added a comment.

Change to `error`


https://reviews.llvm.org/D38020

Files:
  COFF/Chunks.cpp


Index: COFF/Chunks.cpp
===================================================================
--- COFF/Chunks.cpp
+++ COFF/Chunks.cpp
@@ -62,7 +62,8 @@
     fatal("SECREL relocation cannot be applied to absolute symbols");
   }
   uint64_t SecRel = S - OS->getRVA();
-  assert(SecRel < INT32_MAX && "overflow in SECREL relocation");
+  if (SecRel > UINT32_MAX)
+    error("overflow in SECREL relocation in section: " + Sec->getSectionName());
   add32(Off, SecRel);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38020.115933.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170920/b7466b04/attachment.bin>


More information about the llvm-commits mailing list