projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a716618
)
Use wider type for overflow check on LLP64 platforms like Win64, found by clang-cl...
author
Reid Kleckner
<reid@kleckner.net>
Thu, 26 Feb 2015 21:07:30 +0000
(21:07 +0000)
committer
Reid Kleckner
<reid@kleckner.net>
Thu, 26 Feb 2015 21:07:30 +0000
(21:07 +0000)
llvm-svn: 230684
llvm/lib/Support/regcomp.c
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/regcomp.c
b/llvm/lib/Support/regcomp.c
index
b796929
..
ebde64f
100644
(file)
--- 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 ((u
nsigned long
)size > SIZE_MAX / sizeof(sop)) {
+ if ((u
intptr_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 ((u
nsigned long
)p->slen > SIZE_MAX / sizeof(sop)) {
+ if ((u
intptr_t
)p->slen > SIZE_MAX / sizeof(sop)) {
g->strip = p->strip;
SETERROR(REG_ESPACE);
return;