Fix issue 1076 by resetting labels of switch-clauses before use.
If we compile a function literal twice with the full code generator, we must make sure that the labels embedded in the AST are reset. BUG=1076 Review URL: http://codereview.chromium.org/6339014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
eb3970c822
commit
38b91a4ffe
@ -734,6 +734,8 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
|||||||
// Compile all the tests with branches to their bodies.
|
// Compile all the tests with branches to their bodies.
|
||||||
for (int i = 0; i < clauses->length(); i++) {
|
for (int i = 0; i < clauses->length(); i++) {
|
||||||
CaseClause* clause = clauses->at(i);
|
CaseClause* clause = clauses->at(i);
|
||||||
|
clause->body_target()->entry_label()->Unuse();
|
||||||
|
|
||||||
// The default is not a test, but remember it as final fall through.
|
// The default is not a test, but remember it as final fall through.
|
||||||
if (clause->is_default()) {
|
if (clause->is_default()) {
|
||||||
default_clause = clause;
|
default_clause = clause;
|
||||||
|
@ -764,6 +764,8 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
|||||||
// Compile all the tests with branches to their bodies.
|
// Compile all the tests with branches to their bodies.
|
||||||
for (int i = 0; i < clauses->length(); i++) {
|
for (int i = 0; i < clauses->length(); i++) {
|
||||||
CaseClause* clause = clauses->at(i);
|
CaseClause* clause = clauses->at(i);
|
||||||
|
clause->body_target()->entry_label()->Unuse();
|
||||||
|
|
||||||
// The default is not a test, but remember it as final fall through.
|
// The default is not a test, but remember it as final fall through.
|
||||||
if (clause->is_default()) {
|
if (clause->is_default()) {
|
||||||
default_clause = clause;
|
default_clause = clause;
|
||||||
|
@ -710,6 +710,8 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
|||||||
// Compile all the tests with branches to their bodies.
|
// Compile all the tests with branches to their bodies.
|
||||||
for (int i = 0; i < clauses->length(); i++) {
|
for (int i = 0; i < clauses->length(); i++) {
|
||||||
CaseClause* clause = clauses->at(i);
|
CaseClause* clause = clauses->at(i);
|
||||||
|
clause->body_target()->entry_label()->Unuse();
|
||||||
|
|
||||||
// The default is not a test, but remember it as final fall through.
|
// The default is not a test, but remember it as final fall through.
|
||||||
if (clause->is_default()) {
|
if (clause->is_default()) {
|
||||||
default_clause = clause;
|
default_clause = clause;
|
||||||
|
Loading…
Reference in New Issue
Block a user