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

Prevent panic on invalid CPP demanglings #11

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Prevent panic on invalid CPP demanglings #11

merged 1 commit into from
Sep 28, 2024

Conversation

surma
Copy link
Owner

@surma surma commented Sep 28, 2024

Fixes(?) #10

cpp_demangle has a Display implementation that treats demangling errors as printing errors. So an invalid C++ function name will cause a full-blown panic.

This PR moves from .to_string() to .demangle()?.to_string(), which prevents that code path.

Copy link

netlify bot commented Sep 28, 2024

Deploy Preview for wasmphobia ready!

Name Link
🔨 Latest commit 4869470
🔍 Latest deploy log https://app.netlify.com/sites/wasmphobia/deploys/66f7e219ee59bb00085394b4
😎 Deploy Preview https://deploy-preview-11--wasmphobia.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@surma surma mentioned this pull request Sep 28, 2024
@surma
Copy link
Owner Author

surma commented Sep 28, 2024

Also opened a PR for upstream fix: gimli-rs/cpp_demangle#296

@surma surma merged commit 70c72c0 into main Sep 28, 2024
4 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.

1 participant