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

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

Issue 2548243004: Return false in TryNumberToSize if there is a cast error (Closed)
Patch Set: Return false in TryNumberToSize if the number is 1 << 64. Created 4 years 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/conversions-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-conversions.cc
diff --git a/test/cctest/test-conversions.cc b/test/cctest/test-conversions.cc
index 2fee58a46d11a96f7370c5522fb541c3bce766f0..d13badd20273ad31a236f4673b8758b190e4da9f 100644
--- a/test/cctest/test-conversions.cc
+++ b/test/cctest/test-conversions.cc
@@ -444,3 +444,15 @@ TEST(NoHandlesForTryNumberToSize) {
}
}
}
+
+TEST(TryNumberToSizeWithMaxSizePlusOne) {
+ i::Isolate* isolate = CcTest::i_isolate();
+ {
+ HandleScope scope(isolate);
+ // 1 << 64, larger than the limit of size_t.
+ double value = 18446744073709551616.0;
+ size_t result = 0;
+ Handle<HeapNumber> heap_number = isolate->factory()->NewHeapNumber(value);
+ CHECK(!TryNumberToSize(*heap_number, &result));
+ }
+}
« no previous file with comments | « src/conversions-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698