[Dlang-internal] UDA segfaults compiler

Elmar chrehme at gmx.de
Sat Jul 17 16:33:54 UTC 2021


Hello D people,

I found a segmentation fault which I can reproduce with `dmd` and 
`ldc2`.

The attack code is simple:

```
alias getOne = @(0) function int () => 1;
```

It works without the UDA but segfaults with it. I found it 
because I wanted to have user-defined attributes to the return 
values of functions. I can't put the UDA after `function` so I 
put it before.

I believe, this is a forgotton corner case or something because 
the compiler tells me, UDAs are not allowed in alias definitions.



More information about the Dlang-internal mailing list