2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
[WebKit-https.git] / JavaScriptCore / kjs / nodes.cpp
index 349c01b6e534c14647c8f372401051c59f51bb89..c216245b1c6603972d72d2ce4ffee49d8a108bf8 100644 (file)
@@ -1509,17 +1509,19 @@ RegisterID* CaseBlockNode::emitCodeForBlock(CodeGenerator& generator, RegisterID
 
     // Setup jumps
     for (ClauseListNode* list = m_list1.get(); list; list = list->getNext()) {
-        RegisterID* clauseVal = generator.emitNode(list->getClause()->expr());
-        generator.emitBinaryOp(op_stricteq, clauseVal, clauseVal, switchExpression);
+        RefPtr<RegisterID> clauseVal = generator.newTemporary();
+        generator.emitNode(clauseVal.get(), list->getClause()->expr());
+        generator.emitBinaryOp(op_stricteq, clauseVal.get(), clauseVal.get(), switchExpression);
         labelVector.append(generator.newLabel());
-        generator.emitJumpIfTrue(clauseVal, labelVector[labelVector.size() - 1].get());
+        generator.emitJumpIfTrue(clauseVal.get(), labelVector[labelVector.size() - 1].get());
     }
 
     for (ClauseListNode* list = m_list2.get(); list; list = list->getNext()) {
-        RegisterID* clauseVal = generator.emitNode(list->getClause()->expr());
-        generator.emitBinaryOp(op_stricteq, clauseVal, clauseVal, switchExpression);
+        RefPtr<RegisterID> clauseVal = generator.newTemporary();
+        generator.emitNode(clauseVal.get(), list->getClause()->expr());
+        generator.emitBinaryOp(op_stricteq, clauseVal.get(), clauseVal.get(), switchExpression);
         labelVector.append(generator.newLabel());
-        generator.emitJumpIfTrue(clauseVal, labelVector[labelVector.size() - 1].get());
+        generator.emitJumpIfTrue(clauseVal.get(), labelVector[labelVector.size() - 1].get());
     }
 
     RefPtr<LabelID> defaultLabel;