about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-18 04:27:51 +0200
committerGitHub <noreply@github.com>2025-07-18 04:27:51 +0200
commit23961091e40e39800043988ed93533a549cd7363 (patch)
tree3efe6fe19b9c226d3cc3713f73503df289f2b726 /tests/rustdoc-js-std/parser-errors.js
parent7ff6135dd6bc7c1c508d128d2522c141805a3862 (diff)
parente55baf9f7ada72ed9f661194065154a09aab3a9e (diff)
downloadrust-23961091e40e39800043988ed93533a549cd7363.tar.gz
rust-23961091e40e39800043988ed93533a549cd7363.zip
Rollup merge of #143293 - folkertdev:naked-function-kcfi, r=compiler-errors
fix `-Zsanitizer=kcfi` on `#[naked]` functions

fixes https://github.com/rust-lang/rust/issues/143266

With `-Zsanitizer=kcfi`, indirect calls happen via generated intermediate shim that forwards the call. The generated shim preserves the attributes of the original, including `#[unsafe(naked)]`. The shim is not a naked function though, and violates its invariants (like having a body that consists of a single `naked_asm!` call).

My fix here is to match on the `InstanceKind`, and only use `codegen_naked_asm` when the instance is not a `ReifyShim`. That does beg the question whether there are other `InstanceKind`s that could come up. As far as I can tell the answer is no: calling via `dyn` seems to work find, and `#[track_caller]` is disallowed in combination with `#[naked]`.

r? codegen
````@rustbot```` label +A-naked
cc ````@maurer```` ````@rcvalle````
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions