[exim-cvs] Build: workaround inlining problems on Solaris

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Build: workaround inlining problems on Solaris
Gitweb: https://git.exim.org/exim.git/commitdiff/aaabfafe3fb76b1e09a68317ef4b3d5bc94fa9be
Commit:     aaabfafe3fb76b1e09a68317ef4b3d5bc94fa9be
Parent:     f8d78f744328266ad9f7f48cf5ca8f7d67c227c4
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Jul 25 20:09:18 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Jul 25 20:09:18 2019 +0100


    Build: workaround inlining problems on Solaris
---
 src/src/mytypes.h | 4 ++++
 src/src/store.c   | 2 ++
 src/src/string.c  | 4 ++++
 3 files changed, 10 insertions(+)


diff --git a/src/src/mytypes.h b/src/src/mytypes.h
index aaa6e90..de2371c 100644
--- a/src/src/mytypes.h
+++ b/src/src/mytypes.h
@@ -134,8 +134,12 @@ By extension, a variable pointing to this address is tainted.
static inline BOOL
is_tainted(const void * p)
{
+#ifdef MACRO_PREDEF
+return FALSE;
+#else
extern void * tainted_base, * tainted_top;
return p >= tainted_base && p < tainted_top;
+#endif
}

static inline uschar * __Ustrcat(uschar * dst, const uschar * src, const char * func, int line)
diff --git a/src/src/store.c b/src/src/store.c
index 41ca43d..b7cf4cd 100644
--- a/src/src/store.c
+++ b/src/src/store.c
@@ -710,8 +710,10 @@ int pool = tainted ? store_pool + POOL_TAINT_BASE : store_pool;
BOOL release_ok = !tainted && store_last_get[pool] == block;
uschar * newtext;

+#ifndef MACRO_PREDEF
if (is_tainted(block) != tainted)
die_tainted(US"store_newblock", CUS func, linenumber);
+#endif

newtext = store_get(newsize, tainted);
memcpy(newtext, block, len);
diff --git a/src/src/string.c b/src/src/string.c
index 8cc34a0..2884661 100644
--- a/src/src/string.c
+++ b/src/src/string.c
@@ -1277,8 +1277,10 @@ else if (!(flags & SVFMT_TAINT_NOCHK)) dest_tainted = is_tainted(g->s);

 if (!(flags & SVFMT_TAINT_NOCHK) && !dest_tainted && is_tainted(format))
   {
+#ifndef MACRO_PREDEF
   if (!(flags & SVFMT_REBUFFER))
     die_tainted(US"string_vformat", func, line);
+#endif
   gstring_rebuffer(g);
   dest_tainted = TRUE;
   }
@@ -1507,8 +1509,10 @@ while (*fp)
       gp = CS g->s + g->ptr;
       dest_tainted = TRUE;
       }
+#ifndef MACRO_PREDEF
     else
       die_tainted(US"string_vformat", func, line);
+#endif


     INSERT_STRING:              /* Come to from %D or %M above */