We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90449a5 commit 9838b39Copy full SHA for 9838b39
1 file changed
src/passes/OptimizeInstructions.cpp
@@ -1219,9 +1219,9 @@ struct OptimizeInstructions
1219
// don't do this if it would wrap the pointer
1220
uint64_t value64 = last->value.geti32();
1221
uint64_t offset64 = offset;
1222
- if (value64 <= std::numeric_limits<int32_t>::max() &&
1223
- offset64 <= std::numeric_limits<int32_t>::max() &&
1224
- value64 + offset64 <= std::numeric_limits<int32_t>::max()) {
+ if (value64 <= uint64_t(std::numeric_limits<int32_t>::max()) &&
+ offset64 <= uint64_t(std::numeric_limits<int32_t>::max()) &&
+ value64 + offset64 <= uint64_t(std::numeric_limits<int32_t>::max())) {
1225
last->value = Literal(int32_t(value64 + offset64));
1226
offset = 0;
1227
}
0 commit comments