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

Unified Diff: src/accessors.cc

Issue 2122923003: [debugger] Don't leak holes from generator arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: DCHECK Created 4 years, 5 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 | test/mjsunit/regress/regress-5164.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5164.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698