surma / wasmphobia

https://wasmphobia.surma.technology/
Apache License 2.0
94 stars 5 forks source link

Prevent panic on invalid CPP demanglings #11

Closed surma closed 2 months ago

surma commented 2 months ago

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.

netlify[bot] commented 2 months ago

Deploy Preview for wasmphobia ready!

Name Link
Latest commit 4869470bd65bec7c2f340671d1853beb273c62ee
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 commented 2 months ago

Also opened a PR for upstream fix: https://github.com/gimli-rs/cpp_demangle/pull/296