Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not feed &"" to D3DCompile #5812

Merged
merged 2 commits into from
Jun 14, 2024

Commits on Jun 14, 2024

  1. Do not feed &"" to D3DCompile

    A recent change by rustc, now in 1.79-stable, makes empty str constants
    point to the same location: 0x01. This is an optimization of sorts, not
    stable behavior. Code must not rely on constants having stable addresses
    nor should it pass &"" to APIs expecting CStrs or NULL addresses.
    D3DCompile will segfault if you give it such a pointer, or worse:
    read random garbage addresses!
    
    Pass the NULL pointer to D3DCompile if wgpu lacks a decent CString.
    
    refs:
    - https://learn.microsoft.com/en-us/windows/win32/api/d3dcompiler/nf-d3dcompiler-d3dcompile
    
    Co-authored-by: Jan Hohenheim <[email protected]>
    Co-authored-by: Brezak <[email protected]>
    3 people committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    a6d3d13 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b0f603f View commit details
    Browse the repository at this point in the history