aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/testsuite
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2005-08-18 13:01:54 -0700
committerJim Wilson <wilson@gcc.gnu.org>2005-08-18 13:01:54 -0700
commit2483ad581a25b4e7aad16c11fce6757b6af36d8c (patch)
treee892f1756c7f014246b880abc4d6a071e49ab659 /libmudflap/testsuite
parent9ed8fb9bbc80c980055f9520237c7ab99ac2e660 (diff)
downloadgcc-2483ad581a25b4e7aad16c11fce6757b6af36d8c.zip
gcc-2483ad581a25b4e7aad16c11fce6757b6af36d8c.tar.gz
gcc-2483ad581a25b4e7aad16c11fce6757b6af36d8c.tar.bz2
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. From-SVN: r103256
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 0000000..d8fbec4
--- /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;
+}