I think the crash cannot be triggered by simply compiling a file. You need some plugin (or macro?) that compiles compiles some tree more than once. See the test.

Agree on removing the `if`.