summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/regexec.c
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-24 23:29:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-24 23:29:28 +0000
commit228e6d4cf347820fce53e57c24b266f67a413d85 (patch)
treed2b63a5d9cee710515d33361e84ad0988d2c31fa /llvm/lib/Support/regexec.c
parent3d91b43ad22b69408af224a8d67561038705ec55 (diff)
downloadbcm5719-llvm-228e6d4cf347820fce53e57c24b266f67a413d85.tar.gz
bcm5719-llvm-228e6d4cf347820fce53e57c24b266f67a413d85.zip
Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc. llvm-svn: 162623
Diffstat (limited to 'llvm/lib/Support/regexec.c')
-rw-r--r--llvm/lib/Support/regexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/regexec.c b/llvm/lib/Support/regexec.c
index 007861675ba..bd5e72d4c52 100644
--- a/llvm/lib/Support/regexec.c
+++ b/llvm/lib/Support/regexec.c
@@ -69,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 */
OpenPOWER on IntegriCloud