Skip to content

Commit

Permalink
fix Issue 11965 - Segfault on garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jan 22, 2014
1 parent 19a756f commit e136c87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/declaration.c
Expand Up @@ -723,6 +723,7 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
: Declaration(id)
{
//printf("VarDeclaration('%s')\n", id->toChars());
assert(id);
#ifdef DEBUG
if (!type && !init)
{ printf("VarDeclaration('%s')\n", id->toChars());
Expand Down
2 changes: 1 addition & 1 deletion src/parse.c
Expand Up @@ -3389,7 +3389,7 @@ Dsymbols *Parser::parseDeclarations(StorageClass storage_class, const utf8_t *co
addComment(s, comment);
a->push(s);
}
else
else if (ident)
{
Initializer *init = NULL;
if (token.value == TOKassign)
Expand Down
1 change: 1 addition & 0 deletions test/fail_compilation/ice11965.d
@@ -0,0 +1 @@
u[{b*A,

0 comments on commit e136c87

Please sign in to comment.