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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 12:28:46 PDT 2017


ruiu added inline comments.


================
Comment at: COFF/Chunks.cpp:65
   uint64_t SecRel = S - OS->getRVA();
-  assert(SecRel < INT32_MAX && "overflow in SECREL relocation");
+  assert(SecRel < UINT32_MAX && "overflow in SECREL relocation");
   add32(Off, SecRel);
----------------
Can you use error() instead of assert()? If you can intentionally trigger an assertion, it shouldn't be an assert() but should be handled by error().


https://reviews.llvm.org/D38020





More information about the llvm-commits mailing list