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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2992013002: [vm] Change TypedData_getUint64 native method to silently cast values (Closed)
Patch Set: Created 3 years, 5 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/vm/object.h » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 0b865fdf3952144666315a7d7d2f5245cd8e8f63..869f0411d65187180aea84eef2ce3d682030da43 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2090,12 +2090,12 @@ DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value) {
DARTSCOPE(Thread::Current());
CHECK_CALLBACK_STATE(T);
API_TIMELINE_DURATION;
- RawInteger* integer = Integer::NewFromUint64(value);
- if (integer == Integer::null()) {
+ if (Integer::IsValidUint64(value)) {
+ return Api::NewHandle(T, Integer::NewFromUint64(value));
+ } else {
zra 2017/07/28 21:47:46 else not needed.
alexmarkov 2017/07/28 23:09:29 Done.
return Api::NewError("%s: Cannot create Dart integer from value %" Pu64,
CURRENT_FUNC, value);
}
- return Api::NewHandle(T, integer);
}
DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* str) {
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698