diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-05 08:18:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-05 08:18:48 +0000 |
commit | 913279ed60aa9b7cce6db1b45c90e6e9d548c19b (patch) | |
tree | d7a78ea388ee4dbf8be40e5c8b53fa38c117c327 /lib/Expr | |
parent | 6c3de732d53bc0953078f1f102ba824161f39cd0 (diff) | |
download | klee-913279ed60aa9b7cce6db1b45c90e6e9d548c19b.tar.gz |
Turn an assert into a parse failure.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Expr')
-rw-r--r-- | lib/Expr/Parser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp index e059c675..c20c5d66 100644 --- a/lib/Expr/Parser.cpp +++ b/lib/Expr/Parser.cpp @@ -853,7 +853,10 @@ ExprResult ParserImpl::ParseBinaryParenExpr(const Token &Name, return ConstantExpr::alloc(0, ResTy); ref<Expr> LHS_E = LHS.get(), RHS_E = RHS.get(); - assert(LHS_E->getWidth() == RHS_E->getWidth() && "Mismatched types!"); + if (LHS_E->getWidth() != RHS_E->getWidth()) { + Error("type widths do not match in binary expression", Name); + return ConstantExpr::alloc(0, ResTy); + } switch (Kind) { case Expr::Add: return AddExpr::alloc(LHS_E, RHS_E); |