summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-18 20:01:54 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-18 20:01:54 +0000
commita3fb7997a5beae9ce90f682c7788faedc7b8bbac (patch)
treee892f1756c7f014246b880abc4d6a071e49ab659 /libmudflap/testsuite
parent6be9086512533e232a11658b5b430f56474a3933 (diff)
downloadgcc-a3fb7997a5beae9ce90f682c7788faedc7b8bbac.tar.gz
Fix FreeBSD failure with recursive malloc call.
* mf-hooks1.c (malloc, calloc, realloc, free, __mf_wrap_alloca_indirect): Call BEGIN_MALLOC_PROTECT before calling the real routines, and END_MALLOC_PROTECT afterwards. * mf-impl.h (enum __mf_state_enum): Expand comment. Add in_malloc. (BEGIN_PROTECT): Handle in_malloc state. (BEGIN_MALLOC_PROTECT, END_MALLOC_PROTECT): New. * testsuite/libmudflap.c/hook2-allocstuff.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103256 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap/testsuite')
-rw-r--r--libmudflap/testsuite/libmudflap.c/hook2-allocstuff.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.c/hook2-allocstuff.c b/libmudflap/testsuite/libmudflap.c/hook2-allocstuff.c
new file mode 100644
index 00000000000..d8fbec4676d
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c/hook2-allocstuff.c
@@ -0,0 +1,9 @@
+/* Generates recursive malloc call on i386-freebsd4.10 with -fmudflap. */
+#include <stdlib.h>
+
+int
+main (void)
+{
+ char *p = malloc (1<<24);
+ return 0;
+}