Repository navigation
Fix DXC assertion after a binding attribute and an inline method - #9072
Open
Arkadiusz Lachowicz (AnastaZIuk) wants to merge 3 commits into
Open
Arkadiusz Lachowicz (AnastaZIuk) wants to merge 3 commits into
Arkadiusz Lachowicz (AnastaZIuk) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The targeted cleanup and regression test address the reported assertion, with only a non-blocking release-note question remaining.
1 open issue
What changed in this PR
Fixes an assertion-enabled DXC crash when a binding attribute referencing a constant is followed by an inline method.
Changes:
- Clears pending ODR-use bookkeeping before parsing a deferred inline method body.
- Adds a SPIR-V regression test for the reported trigger.
| File | Description |
|---|---|
| tools/clang/test/CodeGenSPIRV/lexed-inline-method-odr-use.hlsl | Adds the minimal assertion-crash regression case. |
| tools/clang/lib/Parse/ParseCXXInlineMethods.cpp | Cleans up variable-use state before starting the method definition. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I think we talked past each other on #8324. The DXC bug I reported is an assertion in Debug and I can reproduce it on upstream
mainagain at1527671533a955c40a7e43a68f767fde734c4cb5withLLVM_ENABLE_ASSERTIONS=ON. Release passing isn't the question here.Here's the shader and command I ran.
It hits
MaybeODRUseExprs.empty(). The old #8324 patched build compiles the same shader with assertions on andspirv-valaccepts its output.I also built Clang 23.1.4 with assertions on and tried the same shader there. It passes because Clang parses the attribute argument in a
ConstantEvaluatedcontext and callsCleanupVarDeclMarking()when that context ends. DXC creates that context only for unevaluated arguments, soBindingis left pending and trips the assertion when the inline method starts. That's why #8324 callsCleanupVarDeclMarking()before that method starts.