DataFlowSanitizer: Replace non-instrumented aliases of instrumented functions, and...
[oota-llvm.git] / lib / Support / regexec.c
index 7d70f6e16c78ec58150d1c2712009b0587c8b9d6..bd5e72d4c522074587a39c5093e65007af660e09 100644 (file)
@@ -54,8 +54,9 @@
 #include "regex2.h"
 
 /* macros for manipulating states, small version */
-#define        states  long
-#define        states1 states          /* for later use in llvm_regexec() decision */
+/* FIXME: 'states' is assumed as 'long' on small version. */
+#define        states1 long            /* for later use in llvm_regexec() decision */
+#define        states  states1
 #define        CLEAR(v)        ((v) = 0)
 #define        SET0(v, n)      ((v) &= ~((unsigned long)1 << (n)))
 #define        SET1(v, n)      ((v) |= (unsigned long)1 << (n))
@@ -68,7 +69,7 @@
 #define        SETUP(v)        ((v) = 0)
 #define        onestate        long
 #define        INIT(o, n)      ((o) = (unsigned long)1 << (n))
-#define        INC(o)          ((o) <<= 1)
+#define        INC(o)          ((o) = (unsigned long)(o) << 1)
 #define        ISSTATEIN(v, o) (((v) & (o)) != 0)
 /* some abbreviations; note that some of these know variable names! */
 /* do "if I'm here, I can also be there" etc without branches */
@@ -155,7 +156,7 @@ llvm_regexec(const llvm_regex_t *preg, const char *string, size_t nmatch,
        eflags = GOODFLAGS(eflags);
 
        if (g->nstates <= (long)(CHAR_BIT*sizeof(states1)) && !(eflags&REG_LARGE))
-               return(smatcher(g, (char *)string, nmatch, pmatch, eflags));
+               return(smatcher(g, string, nmatch, pmatch, eflags));
        else
-               return(lmatcher(g, (char *)string, nmatch, pmatch, eflags));
+               return(lmatcher(g, string, nmatch, pmatch, eflags));
 }