bad debug lines for nested AndAndExpression

Johan j at j.nl
Fri Sep 17 16:27:20 UTC 2021


On Friday, 17 September 2021 at 13:42:48 UTC, Basile B wrote:
> I've just reached something strange when debugging code, here's 
> a repro:
>
> 1. create bad_debug_lines.d with the following content
>
> ```d
> module bad_debug_lines;
>
> extern(C) int rand();
>
> int call() {
>     return 1 + rand() % 8; // defeat opts...
> }
>
> void main() {
>     if (call() &&
>         call() &&
>         call() &&
>         call())
>     {}
> }
> ```
>
[...]
>
>
> The problem is somewhat confirmed by the IR view:
> https://godbolt.org/z/bsfaPvPbE, as you can see the coloured 
> block for the ifcondition is only 1 line long.

Yeah I've known about this issue for a long time. Haven't found 
the time to fix it. Your post does add a little motivation for 
fixing it :)

-Johan



More information about the digitalmars-d-ldc mailing list