From 91a91d1054bafa8df1208556c4cefc6afbd2a25e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 23 Jan 2013 23:11:54 +0100 Subject: [PATCH] Fix bug in switch statement Change-Id: I42f509f825d8c095c3762a86e5da881de1038d7d Reviewed-by: Simon Hausmann --- qv4codegen.cpp | 4 ++-- tests/TestExpectations | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/qv4codegen.cpp b/qv4codegen.cpp index 1f68255..3bc545d 100644 --- a/qv4codegen.cpp +++ b/qv4codegen.cpp @@ -2313,7 +2313,7 @@ bool Codegen::visit(SwitchStatement *ast) Result rhs = expression(clause->expression); IR::BasicBlock *iftrue = blockMap[clause]; IR::BasicBlock *iffalse = _function->newBasicBlock(); - cjump(binop(IR::OpEqual, *lhs, *rhs), iftrue, iffalse); + cjump(binop(IR::OpStrictEqual, *lhs, *rhs), iftrue, iffalse); _block = iffalse; } @@ -2322,7 +2322,7 @@ bool Codegen::visit(SwitchStatement *ast) Result rhs = expression(clause->expression); IR::BasicBlock *iftrue = blockMap[clause]; IR::BasicBlock *iffalse = _function->newBasicBlock(); - cjump(binop(IR::OpEqual, *lhs, *rhs), iftrue, iffalse); + cjump(binop(IR::OpStrictEqual, *lhs, *rhs), iftrue, iffalse); _block = iffalse; } diff --git a/tests/TestExpectations b/tests/TestExpectations index 6cdedd2..fc90235 100644 --- a/tests/TestExpectations +++ b/tests/TestExpectations @@ -6,7 +6,6 @@ S15.1.3.2_A2.5_T1 # uses octal number 15.2.3.6-2-17-1 failing - # Tests failing that are supposed to pass. 10.4.2-1-2 failing 10.4.3-1-104 failing @@ -139,10 +138,6 @@ S12.10_A3.4_T4 failing S12.10_A3.4_T5 failing S12.10_A3.5_T4 failing S12.10_A3.5_T5 failing -S12.11_A1_T1 failing -S12.11_A1_T2 failing -S12.11_A1_T3 failing -S12.11_A1_T4 failing 12.14-13 failing 12.10-0-3 failing S12.10_A1.11_T1 failing @@ -363,18 +358,13 @@ S15.2.4.4_A14 failing # Array regressions S15.4.4.4_A1_T2 failing - -# Regressions due to Object/property refactoring 15.4.4.18-7-c-i-6 failing 15.4.4.19-8-c-i-6 failing 15.4.4.20-9-c-i-6 failing 15.4.4.22-8-b-iii-1-6 failing - -# Bugs in Array.prototype 15.4.4.14-9-b-i-5 failing 15.4.4.16-7-c-i-6 failing 15.4.4.17-7-c-i-6 failing - 15.4.4.21-8-b-iii-1-6 failing 15.12.3_4-1-1 -15.12.3_4-1-3 \ No newline at end of file +15.12.3_4-1-3 -- 2.7.4