Skip to content

fix(d): Fix crashes with large component type embeddings - #1704

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
QuantumSegfault:dlang-fix-component-type
Sep 8, 2026
Merged

fix(d): Fix crashes with large component type embeddings#1704
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
QuantumSegfault:dlang-fix-component-type

Conversation

@QuantumSegfault

Copy link
Copy Markdown
Contributor

Currently, when trying to compile generated D bindings against sufficiently large components, there ends up being a stack overflow (or so it seems) in the compiler due to the potentially MASSIVE tree of concatenation expressions used to join the possibly thousands of lines of strings together to form the LLVM IR for the component type section.

Line breaks are needed to keep editors from choking trying to process (e.g. split, syntax highlight, etc.) what would an absurdly long line.

To fix this issue, the raw bytes of the encoded component type are instead embedded as a hex-string (which allows whitespace freely within without it affecting the final contents), and is transformed on the D side at compile time into the string that needs to be embedded into the IR.

@QuantumSegfault

Copy link
Copy Markdown
Contributor Author

@alexcrichton

@alexcrichton
alexcrichton added this pull request to the merge queue Sep 8, 2026
Merged via the queue into bytecodealliance:main with commit 2c40116 Sep 8, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants