Fixed crash, simplified code in testassert.cpp

This commit is contained in:
PKEuS 2014-08-06 12:24:21 +02:00
parent 6545bf7938
commit c3577bc8dd
2 changed files with 1 additions and 4 deletions

View File

@ -1976,7 +1976,7 @@ void CheckOther::checkConstantFunctionParameter()
if (!var || !var->isArgument() || !var->isClass() || !var->isConst() || var->isPointer() || var->isArray() || var->isReference())
continue;
if (var->scope()->function->arg->link()->strAt(-1) == ".")
if (var->scope() && var->scope()->function->arg->link()->strAt(-1) == ".")
continue; // references could not be used as va_start parameters (#5824)
const Token* const tok = var->typeStartToken();

View File

@ -35,10 +35,7 @@ private:
errout.str("");
Settings settings;
settings.addEnabled("style");
settings.addEnabled("warning");
settings.addEnabled("portability");
settings.addEnabled("performance");
// Tokenize..
Tokenizer tokenizer(&settings, this);