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

Backport Do not feed &"" to D3DCompile (#5812) to 0.20 #5831

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

torokati44
Copy link
Contributor

This is #5812 backported to the v0.20 branch.

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]>
@torokati44 torokati44 requested a review from a team as a code owner June 17, 2024 21:40
@torokati44
Copy link
Contributor Author

Ah, I just saw that @Elabajaba is on this right now, so feel free to close this with no further explanation. Sorry for the spam!

@Elabajaba
Copy link
Contributor

Whoops, didn't notice this when I opened mine.

I'll close mine for 0.20.

@teoxoy teoxoy changed the title Do not feed &"" to D3DCompile (#5812) Backport Do not feed &"" to D3DCompile (#5812) to 0.20 Jun 18, 2024
@ErichDonGubler ErichDonGubler merged commit 32d21c8 into gfx-rs:v0.20 Jun 18, 2024
25 checks passed
@ErichDonGubler
Copy link
Member

Just awaiting release (CC @cwfitzgerald).

@torokati44
Copy link
Contributor Author

Is there an estimate of when/if the next 0.20.x release will be out?
Not trying to rush anything, just so we can better judge whether we should go forward with ruffle-rs/ruffle#16786, or wait for a release.

@torokati44
Copy link
Contributor Author

Oh, sorry, I just noticed #5850, never mind then.

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.

4 participants