diff options
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index a0c199e7db..5074378efb 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -1507,10 +1507,9 @@ void JSWriter::generateExpression(const User *I, raw_string_ostream& Code) { break; } case Instruction::Select: { - const SelectInst* SI = cast<SelectInst>(I); - Code << getAssignIfNeeded(I) << getValueAsStr(SI->getCondition()) << " ? " << - getValueAsStr(SI->getTrueValue()) << " : " << - getValueAsStr(SI->getFalseValue()); + Code << getAssignIfNeeded(I) << getValueAsStr(I->getOperand(0)) << " ? " << + getValueAsStr(I->getOperand(1)) << " : " << + getValueAsStr(I->getOperand(2)); break; } case Instruction::AtomicCmpXchg: { |