We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad7ea8b commit 01cdc50Copy full SHA for 01cdc50
tests/ui/abi/stack-protector.rs
@@ -40,6 +40,8 @@ fn vulnerable_function() {
40
// Overwrite the on-stack return address with the address of `malicious_code()`,
41
// thereby jumping to that function when returning from `vulnerable_function()`.
42
unsafe { fill(stackaddr, bad_code_ptr, 20); }
43
+ // Capture the address, so the write is not optimized away.
44
+ std::hint::black_box(stackaddr);
45
}
46
47
// Use an uninlined function with its own stack frame to make sure that we don't
0 commit comments