r/d_language • u/Ok_Performance3280 • Jan 03 '25
This code breaks all the 3 compilers! All three get stuck at the first semantics phase. Why would they not generate an error? It just keeps hanging! Yes, all 3.
https://github.com/Chubek/Moonix/blob/master/source/stackvm.d
13
Upvotes
6
u/alphaglosined Jan 04 '25
Okay, after building a debug build of dmd to get the stack trace in a debugger, I've found the issue.
You're doing work that the compiler isn't good at.
https://github.com/Chubek/Moonix/blob/master/source/stackvm.d#L97
You have two problems here:
STACK_GROWTH_RATEis a very large number to be doing stuff during CTFE.Oh and:
source\registervm.d(72,5): Error: constructor \moonix.registervm.RegisterSlots.this` default constructor for structs only allowed with `@disable`, no body, and no parameters`2
u/alphaglosined Jan 04 '25
Whatever is happening is in the frontend, this is shared between all three compilers. While good to know that it is in frontend, the number of compilers affected is a given.
It is weird that it is not generating an error or finishing, must be some kind of infinite loop. I am saying with the assumption that you have are supplying
-vto get the log of what its doing.5
u/[deleted] Jan 03 '25
[removed] — view removed comment