aboutsummaryrefslogtreecommitdiff
path: root/lib/bcheck.c
diff options
context:
space:
mode:
authorjiang <30155751@qq.com>2014-04-29 16:05:16 +0800
committerjiang <30155751@qq.com>2014-04-29 16:05:16 +0800
commit2a8905c93b4f67a21e3dbf297c3e93c598831528 (patch)
tree6f7491150cfe01700c9863946906203adad0de13 /lib/bcheck.c
parent02e2fe3c260415f4cb1cbcaca9b2403a17f7ff2e (diff)
parente20c1eb99e1003c1e59522c136dbb15c52d7cc7c (diff)
downloadtinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.gz
tinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.bz2
So that the generated code, and more short
Diffstat (limited to 'lib/bcheck.c')
-rw-r--r--lib/bcheck.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 064fb5d..8ac7d4e 100644
--- a/lib/bcheck.c
+++ b/lib/bcheck.c
@@ -22,7 +22,7 @@
#include <stdarg.h>
#include <string.h>
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) \
- && !defined(__DragonFly__) && !defined(__OpenBSD__)
+ && !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
#include <malloc.h>
#endif
#if !defined(_WIN32)
@@ -41,7 +41,7 @@
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
|| defined(__DragonFly__) || defined(__dietlibc__) \
- || defined(__UCLIBC__) || defined(__OpenBSD__) \
+ || defined(__UCLIBC__) || defined(__OpenBSD__) || defined(__NetBSD__) \
|| defined(_WIN32) || defined(TCC_UCLIBC)
#warning Bound checking does not support malloc (etc.) in this environment.
#undef CONFIG_TCC_MALLOC_HOOKS
@@ -418,6 +418,13 @@ void __bound_init(void)
}
}
+void __bound_main_arg(void **p)
+{
+ void *start = p;
+ while (*p++);
+ __bound_new_region(start, (void *) p - start);
+}
+
void __bound_exit(void)
{
restore_malloc_hooks();
@@ -628,7 +635,7 @@ int __bound_delete_region(void *p)
}
/* return the size of the region starting at p, or EMPTY_SIZE if non
- existant region. */
+ existent region. */
static unsigned long get_region_size(void *p)
{
unsigned long addr = (unsigned long)p;