diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-24 21:39:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-24 21:39:56 +0000 |
commit | 9983cc110422a2e976191a0ce6ac4f1d7b634cc0 (patch) | |
tree | a05093e3218265fcaeb4b916d22447c2562d8dba /lib/Analysis/CFG.cpp | |
parent | a24eb4ef63d5860a5a02f7532e56e84283782984 (diff) |
Don't try to evaluate an expression that is type- or value-dependent while building the CFG
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r-- | lib/Analysis/CFG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 08a13c4d8e..3677f7ee0d 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -158,7 +158,8 @@ private: /// if we can evaluate to a known value, otherwise return -1. TryResult TryEvaluateBool(Expr *S) { Expr::EvalResult Result; - if (S->Evaluate(Result, *Context) && Result.Val.isInt()) + if (!S->isTypeDependent() && !S->isValueDependent() && + S->Evaluate(Result, *Context) && Result.Val.isInt()) return Result.Val.getInt().getBoolValue(); return TryResult(); |