1
Fork 0

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.
This commit is contained in:
Nikita Popov 2022-02-21 12:25:54 +01:00
parent 373789b059
commit ebc8ab1e4e

View file

@ -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 _);