Skip to content

Commit

Permalink
Fix Issue 17382 - void main(){}pragma(msg,main()); crashes DMD
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanN7 committed Nov 14, 2017
1 parent 03e806a commit db8c74b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ddmd/hdrgen.d
Original file line number Diff line number Diff line change
Expand Up @@ -2314,6 +2314,9 @@ public:
goto L4;
else
assert(0);
case Tvoid:
buf.writestring("<void>");
break;
default:
/* This can happen if errors, such as
* the type is painted on like in fromConstInitializer().
Expand Down
7 changes: 7 additions & 0 deletions test/compilable/test17382.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module test17382;

void main()
{
}

pragma(msg,main());

0 comments on commit db8c74b

Please sign in to comment.