From: Reid Kleckner Date: Thu, 26 Feb 2015 21:07:30 +0000 (+0000) Subject: Use wider type for overflow check on LLP64 platforms like Win64, found by clang-cl... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1aecd5b8d95bd4d2cd5d50580126e1768a3c5848;p=platform%2Fupstream%2Fllvm.git Use wider type for overflow check on LLP64 platforms like Win64, found by clang-cl -Wtautological llvm-svn: 230684 --- diff --git a/llvm/lib/Support/regcomp.c b/llvm/lib/Support/regcomp.c index b796929..ebde64f 100644 --- a/llvm/lib/Support/regcomp.c +++ b/llvm/lib/Support/regcomp.c @@ -1422,7 +1422,7 @@ enlarge(struct parse *p, sopno size) if (p->ssize >= size) return; - if ((unsigned long)size > SIZE_MAX / sizeof(sop)) { + if ((uintptr_t)size > SIZE_MAX / sizeof(sop)) { SETERROR(REG_ESPACE); return; } @@ -1443,7 +1443,7 @@ static void stripsnug(struct parse *p, struct re_guts *g) { g->nstates = p->slen; - if ((unsigned long)p->slen > SIZE_MAX / sizeof(sop)) { + if ((uintptr_t)p->slen > SIZE_MAX / sizeof(sop)) { g->strip = p->strip; SETERROR(REG_ESPACE); return;