rust/compiler/rustc_llvm
Mark Rousskov bf3deccdad Fix UB in LLVM FFI when passing zero or >1 bundle
Rust passes a *const &OperandBundleDef to these APIs, usually from a
Vec<&OperandBundleDef> or so. Previously we were dereferencing that
pointer and passing it to the ArrayRef constructor with some length (N).

This meant that if the length was 0, we were dereferencing a pointer to
nowhere, and if the length was >1 then loading the *second* element
somewhere in LLVM would've been reading past the end.

Since Rust can't hold OperandBundleDef by-value we're forced to indirect
through a vector that copies out the OperandBundleDefs from the
by-reference list on the Rust side in order to match the LLVM expected
API.
2024-04-14 22:18:33 -04:00
..
llvm-wrapper Fix UB in LLVM FFI when passing zero or >1 bundle 2024-04-14 22:18:33 -04:00
src Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
build.rs Rollup merge of #123294 - Nilstrieb:reuqire-llvm-config, r=clubby789 2024-04-06 08:56:33 +02:00
Cargo.toml Add arm64ec-pc-windows-msvc target 2024-03-06 17:49:37 -08:00