Skip to content

Commit ebc8ab1

Browse files
committed
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.
1 parent 373789b commit ebc8ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/assembly/stack-protector/stack-protector-heuristics-effect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn array_u8_1(f: fn(*const u8)) {
7878
#[no_mangle]
7979
pub fn array_u8_small(f: fn(*const u8)) {
8080
let a = [0u8; 2];
81-
let b = [0u8; 8];
81+
let b = [0u8; 7];
8282
f(&a as *const _);
8383
f(&b as *const _);
8484

0 commit comments

Comments
 (0)