diff options
| author | Nikita Popov <npopov@redhat.com> | 2022-02-21 12:25:54 +0100 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2022-05-25 17:29:37 +0200 |
| commit | ebc8ab1e4e678202977e17a34313a98e7e899ed3 (patch) | |
| tree | 2a70971402676338f68c2166d3ae5ee14c9edaa2 /src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs | |
| parent | 373789b059324adef491bcabfff316c734522e78 (diff) | |
| download | rust-ebc8ab1e4e678202977e17a34313a98e7e899ed3.tar.gz rust-ebc8ab1e4e678202977e17a34313a98e7e899ed3.zip | |
Fix stack protector basic test
This is a >= condition, so we need a maximum size of 7 to not create a stack protector in basic mode. The reason this still worked is that the alloca type was converted into an integer (rather than an array). The way these heuristics are implemented in LLVM is rather questionable and not resilient to optimization.
Diffstat (limited to 'src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs')
| -rw-r--r-- | src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs b/src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs index 530326ab743..7c2b6055090 100644 --- a/src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs +++ b/src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs @@ -78,7 +78,7 @@ pub fn array_u8_1(f: fn(*const u8)) { #[no_mangle] pub fn array_u8_small(f: fn(*const u8)) { let a = [0u8; 2]; - let b = [0u8; 8]; + let b = [0u8; 7]; f(&a as *const _); f(&b as *const _); |
