From 8e98ac162ace2d8bd571d594c66665b7f5e51814 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Thu, 13 May 2010 08:26:32 +0000 Subject: [PATCH] Relax an assertion. Various cases could lead to non-symbol values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103707 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Checker/MallocChecker.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Checker/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp index a22df30469..086dbd8fdd 100644 --- a/lib/Checker/MallocChecker.cpp +++ b/lib/Checker/MallocChecker.cpp @@ -182,7 +182,10 @@ const GRState *MallocChecker::FreeMemAux(CheckerContext &C, const CallExpr *CE, return state; SymbolRef Sym = ArgVal.getAsLocSymbol(); - assert(Sym); + + // Various cases could lead to non-symbol values here. + if (!Sym) + return state; const RefState *RS = state->get(Sym);