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/full-codegen.cc

Issue 3621013: Fix a bug in our handling of conditional expressions in test contexts. (Closed)
Patch Set: Created 10 years, 2 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/full-codegen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 796b0717cf0e84dc1a627cfeed126f4565e2ab2a..97987c27a80c7aae2c1349a12141fbcf171bad70 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1128,9 +1128,14 @@ void FullCodeGenerator::VisitConditional(Conditional* expr) {
__ bind(&true_case);
SetExpressionPosition(expr->then_expression(),
expr->then_expression_position());
- Visit(expr->then_expression());
- // If control flow falls through Visit, jump to done.
- if (!context()->IsTest()) {
+ if (context()->IsTest()) {
+ const TestContext* for_test = TestContext::cast(context());
+ VisitForControl(expr->then_expression(),
+ for_test->true_label(),
+ for_test->false_label(),
+ NULL);
+ } else {
+ Visit(expr->then_expression());
__ jmp(&done);
}
« no previous file with comments | « src/full-codegen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698