Module Name: src Committed By: martin Date: Sat Jul 23 22:17:43 UTC 2011
Modified Files: src/tests/lib/libc/ssp: h_raw.c Log Message: gcc optimizes away the side effect free call to the "poke" function which is supposed to smash our stack in this test case. So: make it print out some dummy value based on the smashing changes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/ssp/h_raw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/ssp/h_raw.c diff -u src/tests/lib/libc/ssp/h_raw.c:1.4 src/tests/lib/libc/ssp/h_raw.c:1.5 --- src/tests/lib/libc/ssp/h_raw.c:1.4 Wed Jun 15 06:09:21 2011 +++ src/tests/lib/libc/ssp/h_raw.c Sat Jul 23 22:17:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: h_raw.c,v 1.4 2011/06/15 06:09:21 plunky Exp $ */ +/* $NetBSD: h_raw.c,v 1.5 2011/07/23 22:17:43 martin Exp $ */ /* * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,8 +29,9 @@ #include <sys/cdefs.h> __COPYRIGHT("@(#) Copyright (c) 2011\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: h_raw.c,v 1.4 2011/06/15 06:09:21 plunky Exp $"); +__RCSID("$NetBSD: h_raw.c,v 1.5 2011/07/23 22:17:43 martin Exp $"); +#include <stdio.h> #include <stdlib.h> void poke(int *, size_t); @@ -38,7 +39,13 @@ void poke(int *b, size_t index) { + size_t i; + int sum = 0; + b[index] = 42; + for (i = 0; i < 10; i++) + sum += b[i]; + printf("dummy value: %d\n", sum); } int