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

Unified Diff: runtime/lib/function.cc

Issue 2723643002: Properly handle instantiator when allocating or cloning closure instance. (Closed)
Patch Set: Created 3 years, 10 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/function.cc
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index 5b2343ff8ff8aa12c93d559535554ddbf6be1931..caf3e1e5aae1a205b1c86087ee8851adf5ec5912 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -76,6 +76,8 @@ DEFINE_NATIVE_ENTRY(Closure_hashCode, 1) {
DEFINE_NATIVE_ENTRY(Closure_clone, 1) {
const Closure& receiver =
Closure::CheckedHandle(zone, arguments->NativeArgAt(0));
+ const TypeArguments& instantiator =
+ TypeArguments::Handle(zone, receiver.instantiator());
const Function& func = Function::Handle(zone, receiver.function());
const Context& ctx = Context::Handle(zone, receiver.context());
Context& cloned_ctx =
@@ -86,7 +88,7 @@ DEFINE_NATIVE_ENTRY(Closure_clone, 1) {
inst = ctx.At(i);
cloned_ctx.SetAt(i, inst);
}
- return Closure::New(func, cloned_ctx);
+ return Closure::New(instantiator, func, cloned_ctx);
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698