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

Unified Diff: src/scopes.h

Issue 464069: Fix for issue 545: don't reuse this VariableProxy. (Closed)
Patch Set: Created 11 years 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
« src/compiler.cc ('K') | « src/compiler.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index fc627df619b4c776ab5e43dfafdbba840cc5aaa9..9b506d989ea2243f49d50fa40ebdb0ae15b08b44 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -206,8 +206,13 @@ class Scope: public ZoneObject {
// ---------------------------------------------------------------------------
// Accessors.
- // The variable corresponding to the (function) receiver.
- VariableProxy* receiver() const { return receiver_; }
+ // A new variable proxy corresponding to the (function) receiver.
+ VariableProxy* receiver() const {
+ VariableProxy* proxy =
+ new VariableProxy(Factory::this_symbol(), true, false);
+ proxy->BindTo(receiver_);
+ return proxy;
+ }
// The variable holding the function literal for named function
// literals, or NULL.
@@ -314,7 +319,7 @@ class Scope: public ZoneObject {
// Declarations.
ZoneList<Declaration*> decls_;
// Convenience variable.
- VariableProxy* receiver_;
+ Variable* receiver_;
// Function variable, if any; function scopes only.
Variable* function_;
// Convenience variable; function scopes only.
« src/compiler.cc ('K') | « src/compiler.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698