[Issue 22592] importC: Segmentation fault indexing global array at run-time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 12 23:25:52 UTC 2021


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

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
As far as I understand it, the issue is that SCstatic is not set until the
variable is known to be going to object file.

However it is referenced *before* this, so all code generated until SCstatic
gets set assumes that the global will be SCglobal.  This is why the segfault
occurs.

Setting SCstatic at Symbol generation time of course fixes this, but I'm not in
a position to say that is the correct thing to do here.

--


More information about the Digitalmars-d-bugs mailing list