diff options
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index 3ff02f17d03..dab5335ae09 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -67,11 +67,13 @@ using namespace clang; using namespace ento; QualType CallEvent::getResultType() const { + ASTContext &Ctx = getState()->getStateManager().getContext(); const Expr *E = getOriginExpr(); - assert(E && "Calls without origin expressions do not have results"); - QualType ResultTy = E->getType(); + if (!E) + return Ctx.VoidTy; + assert(E); - ASTContext &Ctx = getState()->getStateManager().getContext(); + QualType ResultTy = E->getType(); // A function that returns a reference to 'int' will have a result type // of simply 'int'. Check the origin expr's value kind to recover the |

