Fixed #3422 (Internal error in exceptRethrowCopy check)

This commit is contained in:
OGAWA KenIchi 2011-12-17 20:00:15 +01:00 committed by Daniel Marjamäki
parent d21ca7881c
commit 3e9d8e6ae1
1 changed files with 5 additions and 3 deletions

View File

@ -138,9 +138,11 @@ void CheckExceptionSafety::checkRethrowCopy()
endScopeTok = startScopeTok->link();
const unsigned int varid = endBracketTok->previous()->varId();
const Token* rethrowTok = Token::findmatch(startScopeTok->next(), "throw %varid%", endScopeTok->previous(), varid);
if (rethrowTok) {
rethrowCopyError(rethrowTok, endBracketTok->strAt(-1));
if (varid > 0) {
const Token* rethrowTok = Token::findmatch(startScopeTok->next(), "throw %varid%", endScopeTok->previous(), varid);
if (rethrowTok) {
rethrowCopyError(rethrowTok, endBracketTok->strAt(-1));
}
}
}