Index: runtime/lib/function.cc |
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc |
index caf3e1e5aae1a205b1c86087ee8851adf5ec5912..8ba93bafaa59c0c14ee02d4321c58a8c94558f7d 100644 |
--- a/runtime/lib/function.cc |
+++ b/runtime/lib/function.cc |
@@ -76,19 +76,22 @@ 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 = |
- Context::Handle(zone, Context::New(ctx.num_variables())); |
- cloned_ctx.set_parent(Context::Handle(zone, ctx.parent())); |
- Object& inst = Object::Handle(zone); |
- for (int i = 0; i < ctx.num_variables(); i++) { |
- inst = ctx.At(i); |
- cloned_ctx.SetAt(i, inst); |
+ const TypeArguments& instantiator_type_arguments = |
+ TypeArguments::Handle(zone, receiver.instantiator_type_arguments()); |
+ const TypeArguments& function_type_arguments = |
+ TypeArguments::Handle(zone, receiver.function_type_arguments()); |
+ const Function& function = Function::Handle(zone, receiver.function()); |
+ const Context& context = Context::Handle(zone, receiver.context()); |
+ Context& cloned_context = |
+ Context::Handle(zone, Context::New(context.num_variables())); |
+ cloned_context.set_parent(Context::Handle(zone, context.parent())); |
+ Object& instance = Object::Handle(zone); |
+ for (int i = 0; i < context.num_variables(); i++) { |
+ instance = context.At(i); |
+ cloned_context.SetAt(i, instance); |
} |
- return Closure::New(instantiator, func, cloned_ctx); |
+ return Closure::New(instantiator_type_arguments, function_type_arguments, |
+ function, cloned_context); |
} |