[dmd-internals] Internal compiler error handling

Mathias Lang via dmd-internals dmd-internals at puremagic.com
Wed Sep 28 11:19:05 PDT 2016


On 09/28/2016 02:19 PM, Михаил Страшун via dmd-internals wrote:
>
>> One other solution - which doesn't require a language change - would be
>> to use exception for ICE (which are rare anyway)
> Would be interesting to check all usage of `assert` and see:
>
> a) how many of them protect from something truly bad
> b) are there many "real" asserts (i.e. not assert(0)) in general
>
>

I'd say quite a lot:

grep -nR "assert\b*(" src/*.d | grep -v "static assert" | grep -v 
"assert\b*(0)" | wc -l
1083


It is hard to investigate how many prevents bug, but I had a quick look 
and it's not a neglectible amount sadly.


More information about the dmd-internals mailing list