Fix crashes from malformed programs.
This commit is contained in:
4
decl.cpp
4
decl.cpp
@@ -410,6 +410,10 @@ Declarator::InitFromType(const Type *baseType, DeclSpecs *ds) {
|
|||||||
|
|
||||||
Assert(d->declarators.size() == 1);
|
Assert(d->declarators.size() == 1);
|
||||||
Declarator *decl = d->declarators[0];
|
Declarator *decl = d->declarators[0];
|
||||||
|
if (decl == NULL || decl->type == NULL) {
|
||||||
|
Assert(m->errorCount > 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (decl->name == "") {
|
if (decl->name == "") {
|
||||||
// Give a name to any anonymous parameter declarations
|
// Give a name to any anonymous parameter declarations
|
||||||
|
|||||||
Reference in New Issue
Block a user