https://issues.dlang.org/show_bug.cgi?id=23874

RazvanN <razvan.nitu1...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1...@gmail.com

--- Comment #3 from RazvanN <razvan.nitu1...@gmail.com> ---
(In reply to Jan Jurzitza from comment #1)
> note: the code to reproduce has been fixed with
> https://github.com/dlang/dmd/commit/abb7836dd705be4f3c82e606b31d54dd69276476
> on master, but that did not seem intentional and I'm keeping this open until
> the real regression cause has been identified and can be confirmed fixed by
> this.
> 
> Regression was introduced by
> https://github.com/dlang/dmd/commit/276ef2145b2cab876c82845d2d1e943847ea2f3a

Actually, even though the fix was not intentional it is the proper fix.

The underlying issue stems from the fact that the profile gc hook needs to be
given a function name so that it outputs where the allocation takes place
(allocations that are not inside function bodies are compile time allocations
therefore do not require the gc). However, in speculative contexts (such as the
ones provided in this bug report) you are not necessarily inside a function
body, therefore when the hook is instantiated it tries to pass a function name
(taken from a null object). That is why the fix linked here correctly solves
this issue by avoiding to lower to the druntime hook if no code is going to be
generated.

There probably might be other slips of this sort so please file them as
individual bugs (not as comments to this bug report) if you discover them.

I am going to fix the case that is provided in this bug report so please do not
link any other manifestations.

--

Reply via email to