Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: test/cctest/test-api.cc

Issue 264047: X64: Fix bugs affecting Win64. (Closed)
Patch Set: Addressed review comments Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-win32.cc ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/platform-win32.cc ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698