Fixed crash in CheckVaarg::va_list_usage() (#7559)
This commit is contained in:
parent
4f8594a9e0
commit
721bc32b2d
|
@ -129,6 +129,8 @@ void CheckVaarg::va_list_usage()
|
||||||
while (scope->nestedIn && scope->type != Scope::eFor && scope->type != Scope::eWhile && scope->type != Scope::eDo && scope->type != Scope::eSwitch)
|
while (scope->nestedIn && scope->type != Scope::eFor && scope->type != Scope::eWhile && scope->type != Scope::eDo && scope->type != Scope::eSwitch)
|
||||||
scope = scope->nestedIn;
|
scope = scope->nestedIn;
|
||||||
tok = scope->classEnd;
|
tok = scope->classEnd;
|
||||||
|
if (!tok)
|
||||||
|
return;
|
||||||
} else if (_tokenizer->isCPP() && tok->str() == "try") {
|
} else if (_tokenizer->isCPP() && tok->str() == "try") {
|
||||||
open = false;
|
open = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -299,6 +299,17 @@ private:
|
||||||
" BG_TString result(f);\n"
|
" BG_TString result(f);\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #7559
|
||||||
|
check("void mowgli_object_message_broadcast(mowgli_object_t *self, const char *name, ...) {\n"
|
||||||
|
" va_list va;\n"
|
||||||
|
" MOWGLI_LIST_FOREACH(n, self->klass->message_handlers.head) {\n"
|
||||||
|
" if (!strcasecmp(sig2->name, name))\n"
|
||||||
|
" break;\n"
|
||||||
|
" }\n"
|
||||||
|
" va_start(va, name);\n"
|
||||||
|
" va_end(va);\n"
|
||||||
|
"}");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue