aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeren <keren@bluebird.(none)>2014-01-10 10:23:11 -0800
committerkeren <keren@bluebird.(none)>2014-01-10 10:23:11 -0800
commit80b36ab628ecb04d94e2593a61adf321e1325cd4 (patch)
treecccb1557ac26aa5c97f0996f7e18807b97e0361d
parentfdf9fba5785f5c0d285c8cbf2fa51df32ddd878d (diff)
downloadtinycc-80b36ab628ecb04d94e2593a61adf321e1325cd4.tar.gz
tinycc-80b36ab628ecb04d94e2593a61adf321e1325cd4.tar.bz2
Fix missing mem_size assignment when using mmap()
-rw-r--r--tccrun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccrun.c b/tccrun.c
index a53330f..97f4761 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -60,6 +60,8 @@ LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr)
#ifdef HAVE_SELINUX
{ /* Use mmap instead of malloc for Selinux. */
+ s1->mem_size = ret;
+
s1->write_mem = mmap (NULL, ret, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
if (s1->write_mem == MAP_FAILED)