@@ -37,23 +37,9 @@ pub fn array_char(f: fn(*const char)) {
3737 f ( & b as * const _ ) ;
3838 f ( & c as * const _ ) ;
3939
40- // Any type of local array variable leads to stack protection with the
41- // "strong" heuristic. The 'basic' heuristic only adds stack protection to
42- // functions with local array variables of a byte-sized type, however. Since
43- // 'char' is 4 bytes in Rust, this function is not protected by the 'basic'
44- // heuristic
45- //
46- // (This test *also* takes the address of the local stack variables. We
47- // cannot know that this isn't what triggers the `strong` heuristic.
48- // However, the test strategy of passing the address of a stack array to an
49- // external function is sufficient to trigger the `basic` heuristic (see
50- // test `array_u8_large()`). Since the `basic` heuristic only checks for the
51- // presence of stack-local array variables, we can be confident that this
52- // test also captures this part of the `strong` heuristic specification.)
53-
5440 // all: __security_check_cookie
5541 // strong: __security_check_cookie
56- // basic-NOT : __security_check_cookie
42+ // basic: __security_check_cookie
5743 // none-NOT: __security_check_cookie
5844 // missing-NOT: __security_check_cookie
5945}
@@ -231,8 +217,8 @@ pub fn local_large_var_moved(f: fn(Gigastruct)) {
231217 // Even though the local variable conceptually doesn't have its address
232218 // taken, it's so large that the "move" is implemented with a reference to a
233219 // stack-local variable in the ABI. Consequently, this function *is*
234- // protected by the `strong` heuristic . This is also the case for
235- // rvalue-references in C++, regardless of struct size:
220+ // protected. This is also the case for rvalue-references in C++,
221+ // regardless of struct size:
236222 // ```
237223 // cat <<EOF | clang++ -O2 -fstack-protector-strong -S -x c++ - -o - | grep stack_chk
238224 // #include <cstdint>
@@ -246,7 +232,7 @@ pub fn local_large_var_moved(f: fn(Gigastruct)) {
246232
247233 // all: __security_check_cookie
248234 // strong: __security_check_cookie
249- // basic-NOT : __security_check_cookie
235+ // basic: __security_check_cookie
250236 // none-NOT: __security_check_cookie
251237 // missing-NOT: __security_check_cookie
252238}
@@ -259,9 +245,9 @@ pub fn local_large_var_cloned(f: fn(Gigastruct)) {
259245 // A new instance of `Gigastruct` is passed to `f()`, without any apparent
260246 // connection to this stack frame. Still, since instances of `Gigastruct`
261247 // are sufficiently large, it is allocated in the caller stack frame and
262- // passed as a pointer. As such, this function is *also* protected by the
263- // `strong` heuristic, just like `local_large_var_moved`. This is also the
264- // case for pass-by-value of sufficiently large structs in C++:
248+ // passed as a pointer. As such, this function is *also* protected, just
249+ // like `local_large_var_moved`. This is also the case for pass-by-value
250+ // of sufficiently large structs in C++:
265251 // ```
266252 // cat <<EOF | clang++ -O2 -fstack-protector-strong -S -x c++ - -o - | grep stack_chk
267253 // #include <cstdint>
@@ -276,7 +262,7 @@ pub fn local_large_var_cloned(f: fn(Gigastruct)) {
276262
277263 // all: __security_check_cookie
278264 // strong: __security_check_cookie
279- // basic-NOT : __security_check_cookie
265+ // basic: __security_check_cookie
280266 // none-NOT: __security_check_cookie
281267 // missing-NOT: __security_check_cookie
282268}
0 commit comments