microsoft / microsoft/DirectXShaderCompiler

Crash: cast<X>() error when two func call in together! but only any one is Success

Open
#8,150 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug diagnostic incorrect-code
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description

  • Scenario A: Call Tests1(DefaultMemory) only in main()-> Success
  • Scenario B: Call Tests2(ret) only in main()-> Success
  • Scenario A&B (The Bug): Call both in main() -> Crash (cast<X>() argument of incompatible type!)

A very strange and incomprehensible mistake

Steps to Reproduce
godbolt.org full share link
or short link

Actual Behavior
error: cast() argument of incompatible type!
Compiler returned: 5

Environment

  • DXC 1.8.2505
  • Windows10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the HLSL example from the provided Godbolt short link with DXC 1.8.2505, comparing each function call alone with both calls together. Trace the compiler failure from the main entry point and confirm the fix by compiling the combined case without the incompatible cast<X>() error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.