diff options
author | Jonathan Roelofs <jonathan@codesourcery.com> | 2015-06-01 16:23:08 +0000 |
---|---|---|
committer | Jonathan Roelofs <jonathan@codesourcery.com> | 2015-06-01 16:23:08 +0000 |
commit | 104cbf9c326017bf00c30b04f6cb0cd044925dff (patch) | |
tree | 6d10d5702f4954e7d650ad13c7f011dbd7ab3b85 /clang/lib/AST/ExprConstant.cpp | |
parent | 8fcb3986d01603c24f37014a3ca171bf0bc1ad2f (diff) | |
download | bcm5719-llvm-104cbf9c326017bf00c30b04f6cb0cd044925dff.tar.gz bcm5719-llvm-104cbf9c326017bf00c30b04f6cb0cd044925dff.zip |
Fix PR21945: Crash in constant evaluator.
Patch by Косов Евгений!
llvm-svn: 238758
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index d1ec7aea1d2..be24a2ae2c8 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -4276,6 +4276,9 @@ public: BlockScopeRAII Scope(Info); const CompoundStmt *CS = E->getSubStmt(); + if (CS->body_empty()) + return true; + for (CompoundStmt::const_body_iterator BI = CS->body_begin(), BE = CS->body_end(); /**/; ++BI) { @@ -4301,6 +4304,8 @@ public: return false; } } + + llvm_unreachable("Return from function from the loop above."); } /// Visit a value which is evaluated, but whose value is ignored. |