From d3f68a9a5deac138b4a0e9902678baa970f00e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 6 Dec 2008 16:54:45 +0000 Subject: [PATCH] Unreachable code : minor bug fixes --- CheckOther.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CheckOther.cpp b/CheckOther.cpp index 98153e86e..a7e8ffd9f 100644 --- a/CheckOther.cpp +++ b/CheckOther.cpp @@ -806,9 +806,11 @@ void CheckOther::unreachableCode() // Locate the end of the 'return' statement while ( tok && ! TOKEN::Match(tok, ";") ) tok = tok->next; + while ( tok && TOKEN::Match(tok->next, ";") ) + tok = tok->next; // If there is a statement below the return it is unreachable - if (!TOKEN::Match(tok, "; case|default|}") && !TOKEN::Match(tok, "; %var% :")) + if (!TOKEN::Match(tok, "; case|default|}|#") && !TOKEN::Match(tok, "; %var% :")) { std::ostringstream errmsg; errmsg << _tokenizer->fileLine(tok->next) << ": Unreachable code below a 'return'";