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

Unified Diff: runtime/lib/double.cc

Issue 15741019: Ensures that Bigints returned to Dart are all checked by Integer::AsValidInteger. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « no previous file | runtime/lib/integers.cc » ('j') | runtime/lib/integers.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/double.cc
===================================================================
--- runtime/lib/double.cc (revision 23089)
+++ runtime/lib/double.cc (working copy)
@@ -80,11 +80,7 @@
Exceptions::ThrowByType(Exceptions::kUnsupported, args);
}
const Bigint& big = Bigint::Handle(BigintOperations::NewFromDouble(val));
- if (BigintOperations::FitsIntoInt64(big)) {
- return Integer::New(BigintOperations::ToInt64(big));
- } else {
- return big.raw();
- }
+ return big.AsValidInteger();
}
DEFINE_NATIVE_ENTRY(Double_trunc_div, 2) {
« no previous file with comments | « no previous file | runtime/lib/integers.cc » ('j') | runtime/lib/integers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698