Commit 0bc607f
committed
Fix f16/f128 TypeKind UB causing SIGTRAP on aarch64
The `TypeKind` repr(C) enum was missing `X86_FP80`, `FP128`, and
`PPC_FP128` variants (values 4, 5, 6). When `compiler_builtins` is
compiled with `--cfg f128_enabled` (new in recent nightlies), the C FFI
function `LLVMRustGetTypeKind` returns 5 for fp128 types. The Rust enum
had no variant for that discriminant, causing instant undefined behavior
(manifesting as SIGTRAP).
Also adds f16 and f128 cases to the ABI `Reg::llvm_type` float match,
which previously only handled 32 and 64-bit floats.1 parent a5894ad commit 0bc607f
2 files changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
295 | 298 | | |
296 | 299 | | |
297 | 300 | | |
| |||
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
| |||
0 commit comments