summaryrefslogtreecommitdiff
path: root/lib/Support
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
commit1144af3c9b4da48cd581156e05b24261c8de366a (patch)
tree49da576a97bfdab702528643450798baa54c790f /lib/Support
parentcac59d8ae815596f4f6b77d1a5414c0591168ea5 (diff)
downloadllvm-1144af3c9b4da48cd581156e05b24261c8de366a.tar.gz
llvm-1144af3c9b4da48cd581156e05b24261c8de366a.tar.bz2
llvm-1144af3c9b4da48cd581156e05b24261c8de366a.tar.xz
Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/regexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/regexec.c b/lib/Support/regexec.c
index 007861675b..bd5e72d4c5 100644
--- a/lib/Support/regexec.c
+++ b/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 */