about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/should-fail.js
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-04-15 16:56:19 +0100
committerGitHub <noreply@github.com>2024-04-15 16:56:19 +0100
commit4f3a39ba7925fe83d75e0bc7a2c65a200e55f0e4 (patch)
tree5ed1c801a25da3303a69e18c92f28dec56813f4c /tests/rustdoc-js-std/should-fail.js
parent5580ae979579c7ca19b7fd5c55f7f82914ac4d5c (diff)
parentbf3deccdadffbd5903268cca74a60f7101f7e9c3 (diff)
downloadrust-4f3a39ba7925fe83d75e0bc7a2c65a200e55f0e4.tar.gz
rust-4f3a39ba7925fe83d75e0bc7a2c65a200e55f0e4.zip
Rollup merge of #123941 - Mark-Simulacrum:fix-llvm-ub, r=nikic
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 (if the vector on the Rust side didn't actually get allocated or so), 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.
Diffstat (limited to 'tests/rustdoc-js-std/should-fail.js')
0 files changed, 0 insertions, 0 deletions