| Index: src/accessors.cc
|
| diff --git a/src/accessors.cc b/src/accessors.cc
|
| index 8f432cd63b1c36fcf8d27dac7161a7500081a65e..6eac65e020d7d047d20a019d2fedf68f669d7aa8 100644
|
| --- a/src/accessors.cc
|
| +++ b/src/accessors.cc
|
| @@ -874,7 +874,16 @@ Handle<Object> GetFunctionArguments(Isolate* isolate,
|
|
|
| // Copy the parameters to the arguments object.
|
| DCHECK(array->length() == length);
|
| - for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i));
|
| + for (int i = 0; i < length; i++) {
|
| + Object* value = frame->GetParameter(i);
|
| + if (value->IsTheHole(isolate)) {
|
| + // Generators currently use holes as dummy arguments when resuming. We
|
| + // must not leak those.
|
| + DCHECK(IsResumableFunction(function->shared()->kind()));
|
| + value = isolate->heap()->undefined_value();
|
| + }
|
| + array->set(i, value);
|
| + }
|
| arguments->set_elements(*array);
|
|
|
| // Return the freshly allocated arguments object.
|
|
|