[llvm] r252150 - RuntimeDyld: fix -Wtype-limits
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 4 22:24:09 PST 2015
Author: compnerd
Date: Thu Nov 5 00:24:09 2015
New Revision: 252150
URL: http://llvm.org/viewvc/llvm-project?rev=252150&view=rev
Log:
RuntimeDyld: fix -Wtype-limits
Adjust the casted type. By casting to the same size rather than just the
signed-ness, we were asserting tautological statements. NFC.
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h?rev=252150&r1=252149&r2=252150&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h Thu Nov 5 00:24:09 2015
@@ -161,9 +161,9 @@ public:
}
case COFF::IMAGE_REL_I386_SECTION:
// 16-bit section index of the section that contains the target.
- assert(static_cast<int16_t>(RE.SectionID) <= INT16_MAX &&
+ assert(static_cast<int32_t>(RE.SectionID) <= INT16_MAX &&
"relocation overflow");
- assert(static_cast<int16_t>(RE.SectionID) >= INT16_MIN &&
+ assert(static_cast<int32_t>(RE.SectionID) >= INT16_MIN &&
"relocation underflow");
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset
<< " RelType: IMAGE_REL_I386_SECTION Value: " << RE.SectionID
More information about the llvm-commits
mailing list