diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-01 20:37:45 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-01 20:37:45 +0000 |
| commit | df4a58edd82d2ed8ebab3284cce7247942395390 (patch) | |
| tree | 4bda27c651ad76204c69eb5ef0d3bc508a8eb762 /clang/lib/AST | |
| parent | 82ef1abf43b6513a51098f7d5d409b343d83ec25 (diff) | |
| download | bcm5719-llvm-df4a58edd82d2ed8ebab3284cce7247942395390.tar.gz bcm5719-llvm-df4a58edd82d2ed8ebab3284cce7247942395390.zip | |
Fix thinko in r74506, test condition for floats was inverted.
- Refactored slightly to make control flow more obvious.
llvm-svn: 74637
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index ec2005a99fc..eb6b5b725ff 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -499,15 +499,15 @@ APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) { return this->Visit(const_cast<Expr*>(SE)); } else if (SETy->isIntegerType()) { APSInt IntResult; - if (EvaluateInteger(SE, IntResult, Info)) - Result = APValue(IntResult); + if (!EvaluateInteger(SE, IntResult, Info)) + return APValue(); + Result = APValue(IntResult); } else if (SETy->isRealFloatingType()) { APFloat F(0.0); - if (EvaluateFloat(SE, F, Info)) - Result = APValue(F); - } - - if (!Result.isInt() && Result.isFloat()) + if (!EvaluateFloat(SE, F, Info)) + return APValue(); + Result = APValue(F); + } else return APValue(); // For casts of a scalar to ExtVector, convert the scalar to the element type |

