Skip to content

Commit

Permalink
fix Issue 15688 - dmd segfault with an integer call through comma exp…
Browse files Browse the repository at this point in the history
…ression
  • Loading branch information
9rnsr committed Feb 15, 2016
1 parent f0c9a35 commit c5b74fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/expression.d
Expand Up @@ -9101,11 +9101,9 @@ public:
{
/* Rewrite (a,b)(args) as (a,(b(args)))
*/
CommaExp ce = cast(CommaExp)e1;
auto ce = cast(CommaExp)e1;
e1 = ce.e2;
e1.type = ce.type;
ce.e2 = this;
ce.type = null;
return ce.semantic(sc);
}
if (e1.op == TOKdelegate)
Expand Down
13 changes: 13 additions & 0 deletions test/fail_compilation/ice15688.d
@@ -0,0 +1,13 @@
// REQUIRED_ARGS: -o-
/*
TEST_OUTPUT:
---
fail_compilation/ice15688.d(12): Error: undefined identifier 'mappings'
fail_compilation/ice15688.d(12): Error: function expected before (), not 0 of type int
---
*/

void main()
{
(mappings, 0)();
}

0 comments on commit c5b74fe

Please sign in to comment.