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/vm/object.cc

Issue 23658007: Fix crash with cyclic exports (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 26954)
+++ runtime/vm/object.cc (working copy)
@@ -6719,15 +6719,19 @@
RawObject* Library::LookupExport(const String& name) const {
if (HasExports()) {
const Array& exports = Array::Handle(this->exports());
+ // Break potential export cycle while looking up name.
+ StorePointer(&raw_ptr()->exports_, Object::empty_array().raw());
Namespace& ns = Namespace::Handle();
Object& obj = Object::Handle();
for (int i = 0; i < exports.Length(); i++) {
ns ^= exports.At(i);
obj = ns.Lookup(name);
if (!obj.IsNull()) {
- return obj.raw();
+ break;
}
}
+ StorePointer(&raw_ptr()->exports_, exports.raw());
+ return obj.raw();
}
return Object::null();
}
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698