Commit f27e65b
authored
fix(hstr): Fix unsoundness of
**Description:**
This PR fixed an unsoundness of `wtf8`'s transmutation by adding `#[repr(transparent)]` to `struct Wtf8`.
The original forked code didn't add this requirement, making the using of `std::mem::transmute` unsound.
Usage example: https://github.com/h-a-n-a/swc/blob/7142def3e26ea9607c0787714b414c31c2872117/crates/hstr/src/wtf8/mod.rs#L462-L464wtf8's transmutation (#11194)1 parent 4d9633d commit f27e65b
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
0 commit comments