Skip to content

Commit

Permalink
Fix Issue 12824 - REG(2.066) ICE(statement.c) Segfault with label and…
Browse files Browse the repository at this point in the history
… static if
  • Loading branch information
yebblies committed May 30, 2014
1 parent 6827c9a commit 4b94aa3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/statement.c
Expand Up @@ -4916,6 +4916,12 @@ Statement *LabelStatement::scopeCode(Scope *sc, Statement **sentry, Statement **
//printf("LabelStatement::scopeCode()\n");
if (statement)
statement = statement->scopeCode(sc, sentry, sexit, sfinally);
else
{
*sentry = NULL;
*sexit = NULL;
*sfinally = NULL;
}
return this;
}

Expand Down
11 changes: 11 additions & 0 deletions test/runnable/xtest46.d
Expand Up @@ -6740,6 +6740,16 @@ void test10091()
auto arr = cast(ubyte[1]) S10091.e;
}

/***************************************************/

void test12824()
{
label:
static if (0)
{
}
}

/***************************************************/
// 9130

Expand Down Expand Up @@ -7179,6 +7189,7 @@ int main()
test8064();
test8105();
test159();
test12824();
test8283();
test8395();
test5749();
Expand Down

0 comments on commit 4b94aa3

Please sign in to comment.