From 8e88ae66b2cb0a0a0dec18203e9c2c51f2e60622 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Jun 2015 20:17:03 +0300 Subject: Fix issue if both "if" branches terminated by return. --- src/analysis/statement.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/analysis/statement.cpp b/src/analysis/statement.cpp index f83d849..335df2b 100644 --- a/src/analysis/statement.cpp +++ b/src/analysis/statement.cpp @@ -103,8 +103,20 @@ void analyseIfStmt(IfStmtNode *node, const WalkItem &wi, WalkItem &wo) } } + // special case where all branches is ended. + if (returned && wo.isReturned) + { + FOR_EACH (std::set::const_iterator, + it, + wo.checkNullVars) + { + wo.removeNullVars.insert(*it); + } + } + wo.stopWalking = true; wo.isReturned = false; + } } -- cgit v1.2.3-60-g2f50