summaryrefslogtreecommitdiff
path: root/src/analysis/statement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/statement.cpp')
-rw-r--r--src/analysis/statement.cpp12
1 files changed, 12 insertions, 0 deletions
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<std::string>::const_iterator,
+ it,
+ wo.checkNullVars)
+ {
+ wo.removeNullVars.insert(*it);
+ }
+ }
+
wo.stopWalking = true;
wo.isReturned = false;
+
}
}