Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 7906 - [ICE] enum declaration with invalid array literal crashes dmd #877

Merged
merged 1 commit into from
Apr 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ bool arrayHasNonConstPointers(Expressions *elems);

bool hasNonConstPointers(Expression *e)
{
if (e->type->ty == Terror)
return false;

if (e->op == TOKnull)
return false;
if (e->op == TOKstructliteral)
Expand Down
9 changes: 9 additions & 0 deletions test/runnable/xtest46.d
Original file line number Diff line number Diff line change
Expand Up @@ -4966,6 +4966,14 @@ void test7871()
auto a = findSplitBefore7871(line[0 .. $])[0];
}

/***************************************************/
// 7906

void test7906()
{
enum s = [string.min];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to be a runnable test, and this test will always fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is my mistake. Please merge #878 additionally.

}

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

int main()
Expand Down Expand Up @@ -5195,6 +5203,7 @@ int main()
test7735();
test7823();
test7871();
test7906();

printf("Success\n");
return 0;
Expand Down