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

Unified Diff: src/scopeinfo.cc

Issue 1938: Fix bug in function context slot lookup. There were two problems: we... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « src/codegen-ia32.cc ('k') | test/mjsunit/with-function-expression.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.cc
===================================================================
--- src/scopeinfo.cc (revision 267)
+++ src/scopeinfo.cc (working copy)
@@ -484,10 +484,13 @@
ASSERT(name->IsSymbol());
if (code->sinfo_size() > 0) {
Object** p = &Memory::Object_at(code->sinfo_start());
- if (*p++ == name) {
- int n;
- ReadInt(p, &n); // n = number of context slots
- return n -1; // the function context slot is the last entry
+ if (*p == name) {
+ p = ContextEntriesAddr(code);
+ int n; // number of context slots
+ ReadInt(p, &n);
+ ASSERT(n != 0);
+ // The function context slot is the last entry.
+ return n + Context::MIN_CONTEXT_SLOTS - 1;
}
}
return -1;
« no previous file with comments | « src/codegen-ia32.cc ('k') | test/mjsunit/with-function-expression.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698