Fix #23332 and add test case.#23334
Conversation
|
@WalterBright This failure occurred on Windows 11 (latest build). The LLM was able to find it and fix it. This is what Opus had to say: It looks like this possibly a Windows CRT failure? |
|
"%zd" is used throughout the compiler, so patching it in one place won't get you very far. What runtime are you linking the compiler against? The MS runtime supports %z since VS 2015 IIRC. |
|
@rainers I was using build.d, and I have VS2022/2026 installed on my machine, but for some reason it picked MSVCR120.dll which is the 2013 runtime. I happy to revert this change. But we have a bigger problem with how we're doing CRT library selection. Everybody using anything modern will hit this problem. |
|
@rainers On further investigation, it looks like we ship msvcr120.dll in the bin64 folder of the windows installation, and it appears that this is what is used when it cannot find an appropriate newer CRT. Unfortunately, if we're going to stick with MSVCR120.dll, then we cannot use |
| @@ -0,0 +1,5 @@ | |||
| // https://github.com/dlang/dmd/issues/23332 | |||
| // Segfault generating a struct's static initializer symbol when it has a float member. | |||
There was a problem hiding this comment.
This is a misleading test case. Surely structs with float members are already covered by the test suite. And if it's about float members, why is there an unused f() function? From the discussion, it looks like this has nothing to do with the test case and everything to do with the Windows CRT version of the host compiler, which such a snippet doesn't control at all.
There was a problem hiding this comment.
I know. That was discovered after merging.
Fixed with LLM.
LLM Model : Opus 4.8
Prompt:
Instead of reverting the change to tocsym.d, can you fix it to not cause the access violation? Then create a test case using issue number 23332 (#23332).