Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 2a35014aa8d2ec39362796e6ddde99748c189a89..1d1874c4f9a8dcc943d7462b07bba244aaca347c 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -728,7 +728,10 @@ THREADED_TEST(BigInteger) { |
LocalContext env; |
// We cannot add one to a Smi::kMaxValue without wrapping. |
if (i::kSmiValueSize < 32) { |
- int32_t value = i::Smi::kMaxValue + 1; |
+ // The casts allow this to compile, even if Smi::kMaxValue is 2^31-1. |
+ // The code will not be run in that case, due to the "if" guard. |
+ int32_t value = |
+ static_cast<int32_t>(static_cast<uint32_t>(i::Smi::kMaxValue) + 1); |
CHECK(value > i::Smi::kMaxValue); |
CHECK(!i::Smi::IsValid(value)); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |