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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1182103003: Assert typed data is external iff actually not in heap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
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 e969b5088c0332c98f9133cc923018fa8fb0ce46..890319c4b351ffda756b2a3226999c5214579488 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -3631,6 +3631,11 @@ DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object,
}
}
if (FLAG_verify_acquired_data) {
+ if (external) {
koda 2015/06/12 18:03:20 This could be written as a single ASSERT(... != ..
siva 2015/06/12 23:10:15 Should we have a check and an explicit error in Da
koda 2015/06/12 23:23:28 Good idea; I'll do it for all the NewExternal* fun
+ ASSERT(!isolate->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
+ } else {
+ ASSERT(isolate->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
+ }
const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
WeakTable* table = isolate->api_state()->acquired_table();
intptr_t current = table->GetValue(obj.raw());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698