summaryrefslogtreecommitdiff
path: root/ext/pcre/pcre2lib/pcre2_printint.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/pcre2lib/pcre2_printint.c')
-rw-r--r--ext/pcre/pcre2lib/pcre2_printint.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/pcre/pcre2lib/pcre2_printint.c b/ext/pcre/pcre2lib/pcre2_printint.c
index bd10c6b1da..b132d44f8c 100644
--- a/ext/pcre/pcre2lib/pcre2_printint.c
+++ b/ext/pcre/pcre2lib/pcre2_printint.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016-2018 University of Cambridge
+ New API code Copyright (c) 2016-2019 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -393,6 +393,7 @@ for(;;)
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE:
+ case OP_SCRIPT_RUN:
case OP_COND:
case OP_SCOND:
case OP_REVERSE:
@@ -672,17 +673,18 @@ for(;;)
map = (uint8_t *)ccode;
if (invertmap)
{
- for (i = 0; i < 32; i++) inverted_map[i] = ~map[i];
+ /* Using 255 ^ instead of ~ avoids clang sanitize warning. */
+ for (i = 0; i < 32; i++) inverted_map[i] = 255 ^ map[i];
map = inverted_map;
}
for (i = 0; i < 256; i++)
{
- if ((map[i/8] & (1 << (i&7))) != 0)
+ if ((map[i/8] & (1u << (i&7))) != 0)
{
int j;
for (j = i+1; j < 256; j++)
- if ((map[j/8] & (1 << (j&7))) == 0) break;
+ if ((map[j/8] & (1u << (j&7))) == 0) break;
if (i == '-' || i == ']') fprintf(f, "\\");
if (PRINTABLE(i)) fprintf(f, "%c", i);
else fprintf(f, "\\x%02x", i);