diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-08-13 18:00:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-13 18:00:10 -0700 |
| commit | 1f73e898ee1da743bf9b27e529e070424ca25acf (patch) | |
| tree | 1566be836da875beb7e1bf01a777c553fbb4dea9 /src/test/debuginfo | |
| parent | 8c361aa28d42b3fe95675e461f2d96b05de681de (diff) | |
| parent | 050fb380aaa5f95ca27d6365cea06ea614c4cbf7 (diff) | |
| download | rust-1f73e898ee1da743bf9b27e529e070424ca25acf.tar.gz rust-1f73e898ee1da743bf9b27e529e070424ca25acf.zip | |
Rollup merge of #75417 - npmccallum:naked, r=matthewjasper
Don't spill operands onto the stack in naked functions Currently, the code spills operands onto the stack for the purpose of debuginfo. However, naked functions can only contain an asm block. Therefore, attempting to spill the operands on the stack is undefined behavior. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408 Note that this PR reverts https://github.com/rust-lang/rust/pull/74105 which ultimately didn't fix the problem. cc @haraldh @Amanieu @matthewjasper
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/function-arguments-naked.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/test/debuginfo/function-arguments-naked.rs b/src/test/debuginfo/function-arguments-naked.rs deleted file mode 100644 index 5f3a1eb44e4..00000000000 --- a/src/test/debuginfo/function-arguments-naked.rs +++ /dev/null @@ -1,42 +0,0 @@ -// min-lldb-version: 310 - -// We have to ignore android because of this issue: -// https://github.com/rust-lang/rust/issues/74847 -// ignore-android -// -// We need to use inline assembly, so just use one platform -// only-x86_64 - -// compile-flags:-g - -// === GDB TESTS =================================================================================== - -// gdb-command:run - -// gdb-command:info args -// gdb-check:No arguments. -// gdb-command:continue - -// === LLDB TESTS ================================================================================== - -// lldb-command:run - -// lldb-command:frame variable -// lldbg-check:(unsigned long) = 111 (unsigned long) = 222 -// lldbr-check:(unsigned long) = 111 (unsigned long) = 222 -// lldb-command:continue - - -#![feature(asm)] -#![feature(naked_functions)] -#![feature(omit_gdb_pretty_printer_section)] -#![omit_gdb_pretty_printer_section] - -fn main() { - naked(111, 222); -} - -#[naked] -extern "C" fn naked(x: usize, y: usize) { - unsafe { asm!("ret"); } // #break -} |
