Commit d233fd14 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch 'merge-pcre' into 10.1

parents 4fc8961d c1291d7a
...@@ -8,7 +8,7 @@ Email domain: cam.ac.uk ...@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2019 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
All rights reserved All rights reserved
...@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg ...@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Emain domain: freemail.hu Emain domain: freemail.hu
Copyright(c) 2010-2019 Zoltan Herczeg Copyright(c) 2010-2020 Zoltan Herczeg
All rights reserved. All rights reserved.
...@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg ...@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Emain domain: freemail.hu Emain domain: freemail.hu
Copyright(c) 2009-2019 Zoltan Herczeg Copyright(c) 2009-2020 Zoltan Herczeg
All rights reserved. All rights reserved.
......
...@@ -5,6 +5,35 @@ Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All ...@@ -5,6 +5,35 @@ Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All
development is happening in the PCRE2 10.xx series. development is happening in the PCRE2 10.xx series.
Version 8.44 12 February-2020
-----------------------------
1. Setting --enable-jit=auto for an out-of-tree build failed because the
source directory wasn't in the search path for AC_TRY_COMPILE always. Patch
from Ross Burton.
2. Applied a patch from Michael Shigorin to fix 8.43 build on e2k arch
with lcc compiler (EDG frontend based); the problem it fixes is:
lcc: "pcrecpp.cc", line 74: error: declaration aliased to undefined entity
"_ZN7pcrecpp2RE6no_argE" [-Werror]
3. Change 2 for 8.43 omitted (*LF) from the list of start-of-pattern items. Now
added.
4. Fix ARMv5 JIT improper handling of labels right after a constant pool.
5. Small patch to pcreposix.c to set the erroroffset field to -1 immediately
after a successful compile, instead of at the start of matching to avoid a
sanitizer complaint (regexec is supposed to be thread safe).
6. Check the size of the number after (?C as it is read, in order to avoid
integer overflow.
7. Tidy up left shifts to avoid sanitize warnings; also fix one NULL deference
in pcretest.
Version 8.43 23-February-2019 Version 8.43 23-February-2019
----------------------------- -----------------------------
......
...@@ -25,7 +25,7 @@ Email domain: cam.ac.uk ...@@ -25,7 +25,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2019 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
All rights reserved. All rights reserved.
...@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg ...@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Email domain: freemail.hu Email domain: freemail.hu
Copyright(c) 2010-2019 Zoltan Herczeg Copyright(c) 2010-2020 Zoltan Herczeg
All rights reserved. All rights reserved.
...@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg ...@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Email domain: freemail.hu Email domain: freemail.hu
Copyright(c) 2009-2019 Zoltan Herczeg Copyright(c) 2009-2020 Zoltan Herczeg
All rights reserved. All rights reserved.
......
...@@ -5,6 +5,12 @@ Note that this library (now called PCRE1) is now being maintained for bug fixes ...@@ -5,6 +5,12 @@ Note that this library (now called PCRE1) is now being maintained for bug fixes
only. New projects are advised to use the new PCRE2 libraries. only. New projects are advised to use the new PCRE2 libraries.
Release 8.44 12-February-2020
-----------------------------
This is a bug-fix release.
Release 8.43 23-February-2019 Release 8.43 23-February-2019
----------------------------- -----------------------------
......
...@@ -13,9 +13,10 @@ libraries. ...@@ -13,9 +13,10 @@ libraries.
The latest release of PCRE1 is always available in three alternative formats The latest release of PCRE1 is always available in three alternative formats
from: from:
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.bz2 https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.bz2
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.zip https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.zip
There is a mailing list for discussion about the development of PCRE at There is a mailing list for discussion about the development of PCRE at
pcre-dev@exim.org. You can access the archives and subscribe or manage your pcre-dev@exim.org. You can access the archives and subscribe or manage your
...@@ -999,4 +1000,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx. ...@@ -999,4 +1000,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
Philip Hazel Philip Hazel
Email local part: ph10 Email local part: ph10
Email domain: cam.ac.uk Email domain: cam.ac.uk
Last updated: 10 February 2015 Last updated: 12 February 2020
...@@ -9,19 +9,19 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might ...@@ -9,19 +9,19 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty. dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre_major, [8]) m4_define(pcre_major, [8])
m4_define(pcre_minor, [43]) m4_define(pcre_minor, [44])
m4_define(pcre_prerelease, []) m4_define(pcre_prerelease, [])
m4_define(pcre_date, [2019-02-23]) m4_define(pcre_date, [2020-02-12])
# NOTE: The CMakeLists.txt file searches for the above variables in the first # NOTE: The CMakeLists.txt file searches for the above variables in the first
# 50 lines of this file. Please update that if the variables above are moved. # 50 lines of this file. Please update that if the variables above are moved.
# Libtool shared library interface versions (current:revision:age) # Libtool shared library interface versions (current:revision:age)
m4_define(libpcre_version, [3:11:2]) m4_define(libpcre_version, [3:12:2])
m4_define(libpcre16_version, [2:11:2]) m4_define(libpcre16_version, [2:12:2])
m4_define(libpcre32_version, [0:11:0]) m4_define(libpcre32_version, [0:12:0])
m4_define(libpcreposix_version, [0:6:0]) m4_define(libpcreposix_version, [0:7:0])
m4_define(libpcrecpp_version, [0:1:0]) m4_define(libpcrecpp_version, [0:2:0])
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre) AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
...@@ -159,12 +159,15 @@ AC_ARG_ENABLE(jit, ...@@ -159,12 +159,15 @@ AC_ARG_ENABLE(jit,
if test "$enable_jit" = "auto"; then if test "$enable_jit" = "auto"; then
AC_LANG(C) AC_LANG(C)
SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$srcdir
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#define SLJIT_CONFIG_AUTO 1 #define SLJIT_CONFIG_AUTO 1
#include "sljit/sljitConfigInternal.h" #include "sljit/sljitConfigInternal.h"
#if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
#error unsupported #error unsupported
#endif]])], enable_jit=yes, enable_jit=no) #endif]])], enable_jit=yes, enable_jit=no)
CPPFLAGS=$SAVE_CPPFLAGS
fi fi
# Handle --disable-pcregrep-jit (enabled by default) # Handle --disable-pcregrep-jit (enabled by default)
......
...@@ -13,9 +13,10 @@ libraries. ...@@ -13,9 +13,10 @@ libraries.
The latest release of PCRE1 is always available in three alternative formats The latest release of PCRE1 is always available in three alternative formats
from: from:
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.bz2 https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.bz2
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.zip https://ftp.pcre.org/pub/pcre/pcre-x.xx.tar.zip
There is a mailing list for discussion about the development of PCRE at There is a mailing list for discussion about the development of PCRE at
pcre-dev@exim.org. You can access the archives and subscribe or manage your pcre-dev@exim.org. You can access the archives and subscribe or manage your
...@@ -999,4 +1000,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx. ...@@ -999,4 +1000,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
Philip Hazel Philip Hazel
Email local part: ph10 Email local part: ph10
Email domain: cam.ac.uk Email domain: cam.ac.uk
Last updated: 10 February 2015 Last updated: 12 February 2020
...@@ -143,7 +143,7 @@ performance. ...@@ -143,7 +143,7 @@ performance.
One way of guarding against this possibility is to use the One way of guarding against this possibility is to use the
<b>pcre_fullinfo()</b> function to check the compiled pattern's options for UTF. <b>pcre_fullinfo()</b> function to check the compiled pattern's options for UTF.
Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at
compile time. This causes an compile time error if a pattern contains a compile time. This causes a compile time error if a pattern contains a
UTF-setting sequence. UTF-setting sequence.
</P> </P>
<P> <P>
......
...@@ -1246,7 +1246,7 @@ the following negative numbers: ...@@ -1246,7 +1246,7 @@ the following negative numbers:
PCRE_ERROR_BADOPTION the value of <i>what</i> was invalid PCRE_ERROR_BADOPTION the value of <i>what</i> was invalid
PCRE_ERROR_UNSET the requested field is not set PCRE_ERROR_UNSET the requested field is not set
</pre> </pre>
The "magic number" is placed at the start of each compiled pattern as an simple The "magic number" is placed at the start of each compiled pattern as a simple
check against passing an arbitrary memory pointer. The endianness error can check against passing an arbitrary memory pointer. The endianness error can
occur if a compiled pattern is saved and reloaded on a different host. Here is occur if a compiled pattern is saved and reloaded on a different host. Here is
a typical call of <b>pcre_fullinfo()</b>, to obtain the length of the compiled a typical call of <b>pcre_fullinfo()</b>, to obtain the length of the compiled
...@@ -1318,7 +1318,7 @@ returned. For anchored patterns, -2 is returned. ...@@ -1318,7 +1318,7 @@ returned. For anchored patterns, -2 is returned.
</pre> </pre>
Return the value of the first data unit (non-UTF character) of any matched Return the value of the first data unit (non-UTF character) of any matched
string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1;
otherwise return 0. The fourth argument should point to an <b>uint_t</b> otherwise return 0. The fourth argument should point to a <b>uint_t</b>
variable. variable.
</P> </P>
<P> <P>
...@@ -1577,7 +1577,7 @@ returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for ...@@ -1577,7 +1577,7 @@ returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for
</pre> </pre>
Return the value of the rightmost literal data unit that must exist in any Return the value of the rightmost literal data unit that must exist in any
matched string, other than at its start, if such a value has been recorded. The matched string, other than at its start, if such a value has been recorded. The
fourth argument should point to an <b>uint32_t</b> variable. If there is no such fourth argument should point to a <b>uint32_t</b> variable. If there is no such
value, 0 is returned. value, 0 is returned.
</P> </P>
<br><a name="SEC16" href="#TOC1">REFERENCE COUNTS</a><br> <br><a name="SEC16" href="#TOC1">REFERENCE COUNTS</a><br>
......
...@@ -99,23 +99,21 @@ the 16-bit library, or <b>pcre32_xx</b> when using the 32-bit library". ...@@ -99,23 +99,21 @@ the 16-bit library, or <b>pcre32_xx</b> when using the 32-bit library".
<br><a name="SEC4" href="#TOC1">COMMAND LINE OPTIONS</a><br> <br><a name="SEC4" href="#TOC1">COMMAND LINE OPTIONS</a><br>
<P> <P>
<b>-8</b> <b>-8</b>
If both the 8-bit library has been built, this option causes the 8-bit library If the 8-bit library has been built, this option causes it to be used (this is
to be used (which is the default); if the 8-bit library has not been built, the default). If the 8-bit library has not been built, this option causes an
this option causes an error. error.
</P> </P>
<P> <P>
<b>-16</b> <b>-16</b>
If both the 8-bit or the 32-bit, and the 16-bit libraries have been built, this If the 16-bit library has been built, this option causes it to be used. If only
option causes the 16-bit library to be used. If only the 16-bit library has been the 16-bit library has been built, this is the default. If the 16-bit library
built, this is the default (so has no effect). If only the 8-bit or the 32-bit has not been built, this option causes an error.
library has been built, this option causes an error.
</P> </P>
<P> <P>
<b>-32</b> <b>-32</b>
If both the 8-bit or the 16-bit, and the 32-bit libraries have been built, this If the 32-bit library has been built, this option causes it to be used. If only
option causes the 32-bit library to be used. If only the 32-bit library has been the 32-bit library has been built, this is the default. If the 32-bit library
built, this is the default (so has no effect). If only the 8-bit or the 16-bit has not been built, this option causes an error.
library has been built, this option causes an error.
</P> </P>
<P> <P>
<b>-b</b> <b>-b</b>
...@@ -1154,9 +1152,9 @@ Cambridge CB2 3QH, England. ...@@ -1154,9 +1152,9 @@ Cambridge CB2 3QH, England.
</P> </P>
<br><a name="SEC17" href="#TOC1">REVISION</a><br> <br><a name="SEC17" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 23 February 2017 Last updated: 10 February 2020
<br> <br>
Copyright &copy; 1997-2017 University of Cambridge. Copyright &copy; 1997-2020 University of Cambridge.
<br> <br>
<p> <p>
Return to the <a href="index.html">PCRE index page</a>. Return to the <a href="index.html">PCRE index page</a>.
......
...@@ -16,8 +16,8 @@ DESCRIPTION ...@@ -16,8 +16,8 @@ DESCRIPTION
pcre-config returns the configuration of the installed PCRE libraries pcre-config returns the configuration of the installed PCRE libraries
and the options required to compile a program to use them. Some of the and the options required to compile a program to use them. Some of the
options apply only to the 8-bit, or 16-bit, or 32-bit libraries, options apply only to the 8-bit, or 16-bit, or 32-bit libraries, re-
respectively, and are not available if only one of those libraries has spectively, and are not available if only one of those libraries has
been built. If an unavailable option is encountered, the "usage" infor- been built. If an unavailable option is encountered, the "usage" infor-
mation is output. mation is output.
...@@ -36,37 +36,37 @@ OPTIONS ...@@ -36,37 +36,37 @@ OPTIONS
--version Writes the version number of the installed PCRE libraries to --version Writes the version number of the installed PCRE libraries to
the standard output. the standard output.
--libs Writes to the standard output the command line options --libs Writes to the standard output the command line options re-
required to link with the 8-bit PCRE library (-lpcre on many quired to link with the 8-bit PCRE library (-lpcre on many
systems). systems).
--libs16 Writes to the standard output the command line options --libs16 Writes to the standard output the command line options re-
required to link with the 16-bit PCRE library (-lpcre16 on quired to link with the 16-bit PCRE library (-lpcre16 on many
many systems). systems).
--libs32 Writes to the standard output the command line options --libs32 Writes to the standard output the command line options re-
required to link with the 32-bit PCRE library (-lpcre32 on quired to link with the 32-bit PCRE library (-lpcre32 on many
many systems). systems).
--libs-cpp --libs-cpp
Writes to the standard output the command line options Writes to the standard output the command line options re-
required to link with PCRE's C++ wrapper library (-lpcrecpp quired to link with PCRE's C++ wrapper library (-lpcrecpp
-lpcre on many systems). -lpcre on many systems).
--libs-posix --libs-posix
Writes to the standard output the command line options Writes to the standard output the command line options re-
required to link with PCRE's POSIX API wrapper library quired to link with PCRE's POSIX API wrapper library
(-lpcreposix -lpcre on many systems). (-lpcreposix -lpcre on many systems).
--cflags Writes to the standard output the command line options --cflags Writes to the standard output the command line options re-
required to compile files that use PCRE (this may include quired to compile files that use PCRE (this may include some
some -I options, but is blank on many systems). -I options, but is blank on many systems).
--cflags-posix --cflags-posix
Writes to the standard output the command line options Writes to the standard output the command line options re-
required to compile files that use PCRE's POSIX API wrapper quired to compile files that use PCRE's POSIX API wrapper li-
library (this may include some -I options, but is blank on brary (this may include some -I options, but is blank on many
many systems). systems).
SEE ALSO SEE ALSO
......
...@@ -146,7 +146,7 @@ performance. ...@@ -146,7 +146,7 @@ performance.
One way of guarding against this possibility is to use the One way of guarding against this possibility is to use the
\fBpcre_fullinfo()\fP function to check the compiled pattern's options for UTF. \fBpcre_fullinfo()\fP function to check the compiled pattern's options for UTF.
Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at
compile time. This causes an compile time error if a pattern contains a compile time. This causes a compile time error if a pattern contains a
UTF-setting sequence. UTF-setting sequence.
.P .P
If your application is one that supports UTF, be aware that validity checking If your application is one that supports UTF, be aware that validity checking
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1227,7 +1227,7 @@ the following negative numbers: ...@@ -1227,7 +1227,7 @@ the following negative numbers:
PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid
PCRE_ERROR_UNSET the requested field is not set PCRE_ERROR_UNSET the requested field is not set
.sp .sp
The "magic number" is placed at the start of each compiled pattern as an simple The "magic number" is placed at the start of each compiled pattern as a simple
check against passing an arbitrary memory pointer. The endianness error can check against passing an arbitrary memory pointer. The endianness error can
occur if a compiled pattern is saved and reloaded on a different host. Here is occur if a compiled pattern is saved and reloaded on a different host. Here is
a typical call of \fBpcre_fullinfo()\fP, to obtain the length of the compiled a typical call of \fBpcre_fullinfo()\fP, to obtain the length of the compiled
...@@ -1294,7 +1294,7 @@ returned. For anchored patterns, -2 is returned. ...@@ -1294,7 +1294,7 @@ returned. For anchored patterns, -2 is returned.
.sp .sp
Return the value of the first data unit (non-UTF character) of any matched Return the value of the first data unit (non-UTF character) of any matched
string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1;
otherwise return 0. The fourth argument should point to an \fBuint_t\fP otherwise return 0. The fourth argument should point to a \fBuint_t\fP
variable. variable.
.P .P
In the 8-bit library, the value is always less than 256. In the 16-bit library In the 8-bit library, the value is always less than 256. In the 16-bit library
...@@ -1560,7 +1560,7 @@ returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for ...@@ -1560,7 +1560,7 @@ returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for
.sp .sp
Return the value of the rightmost literal data unit that must exist in any Return the value of the rightmost literal data unit that must exist in any
matched string, other than at its start, if such a value has been recorded. The matched string, other than at its start, if such a value has been recorded. The
fourth argument should point to an \fBuint32_t\fP variable. If there is no such fourth argument should point to a \fBuint32_t\fP variable. If there is no such
value, 0 is returned. value, 0 is returned.
. .
. .
......
This diff is collapsed.
.TH PCRETEST 1 "23 February 2017" "PCRE 8.41" .TH PCRETEST 1 "10 February 2020" "PCRE 8.44"
.SH NAME .SH NAME
pcretest - a program for testing Perl-compatible regular expressions. pcretest - a program for testing Perl-compatible regular expressions.
.SH SYNOPSIS .SH SYNOPSIS
...@@ -78,21 +78,19 @@ the 16-bit library, or \fBpcre32_xx\fP when using the 32-bit library". ...@@ -78,21 +78,19 @@ the 16-bit library, or \fBpcre32_xx\fP when using the 32-bit library".
.rs .rs
.TP 10 .TP 10
\fB-8\fP \fB-8\fP
If both the 8-bit library has been built, this option causes the 8-bit library If the 8-bit library has been built, this option causes it to be used (this is
to be used (which is the default); if the 8-bit library has not been built, the default). If the 8-bit library has not been built, this option causes an
this option causes an error. error.
.TP 10 .TP 10
\fB-16\fP \fB-16\fP
If both the 8-bit or the 32-bit, and the 16-bit libraries have been built, this If the 16-bit library has been built, this option causes it to be used. If only
option causes the 16-bit library to be used. If only the 16-bit library has been the 16-bit library has been built, this is the default. If the 16-bit library
built, this is the default (so has no effect). If only the 8-bit or the 32-bit has not been built, this option causes an error.
library has been built, this option causes an error.
.TP 10 .TP 10
\fB-32\fP \fB-32\fP
If both the 8-bit or the 16-bit, and the 32-bit libraries have been built, this If the 32-bit library has been built, this option causes it to be used. If only
option causes the 32-bit library to be used. If only the 32-bit library has been the 32-bit library has been built, this is the default. If the 32-bit library
built, this is the default (so has no effect). If only the 8-bit or the 16-bit has not been built, this option causes an error.
library has been built, this option causes an error.
.TP 10 .TP 10
\fB-b\fP \fB-b\fP
Behave as if each pattern has the \fB/B\fP (show byte code) modifier; the Behave as if each pattern has the \fB/B\fP (show byte code) modifier; the
...@@ -1155,6 +1153,6 @@ Cambridge CB2 3QH, England. ...@@ -1155,6 +1153,6 @@ Cambridge CB2 3QH, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 23 February 2017 Last updated: 10 February 2020
Copyright (c) 1997-2017 University of Cambridge. Copyright (c) 1997-2020 University of Cambridge.
.fi .fi
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2018 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -68,7 +68,7 @@ COMPILE_PCREx macro will already be appropriately set. */ ...@@ -68,7 +68,7 @@ COMPILE_PCREx macro will already be appropriately set. */
/* Macro for setting individual bits in class bitmaps. */ /* Macro for setting individual bits in class bitmaps. */
#define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7)) #define SETBIT(a,b) a[(b)/8] |= (1U << ((b)&7))
/* Maximum length value to check against when making sure that the integer that /* Maximum length value to check against when making sure that the integer that
holds the compiled pattern length does not overflow. We make it a bit less than holds the compiled pattern length does not overflow. We make it a bit less than
...@@ -129,8 +129,8 @@ overrun before it actually does run off the end of the data block. */ ...@@ -129,8 +129,8 @@ overrun before it actually does run off the end of the data block. */
/* Private flags added to firstchar and reqchar. */ /* Private flags added to firstchar and reqchar. */
#define REQ_CASELESS (1 << 0) /* Indicates caselessness */ #define REQ_CASELESS (1U << 0) /* Indicates caselessness */
#define REQ_VARY (1 << 1) /* Reqchar followed non-literal item */ #define REQ_VARY (1U << 1) /* Reqchar followed non-literal item */
/* Negative values for the firstchar and reqchar flags */ /* Negative values for the firstchar and reqchar flags */
#define REQ_UNSET (-2) #define REQ_UNSET (-2)
#define REQ_NONE (-1) #define REQ_NONE (-1)
...@@ -3612,7 +3612,7 @@ for(;;) ...@@ -3612,7 +3612,7 @@ for(;;)
if (chr > 255) break; if (chr > 255) break;
class_bitset = (pcre_uint8 *) class_bitset = (pcre_uint8 *)
((list_ptr == list ? code : base_end) - list_ptr[2]); ((list_ptr == list ? code : base_end) - list_ptr[2]);
if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE; if ((class_bitset[chr >> 3] & (1U << (chr & 7))) != 0) return FALSE;
break; break;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
...@@ -7133,15 +7133,17 @@ for (;; ptr++) ...@@ -7133,15 +7133,17 @@ for (;; ptr++)
int n = 0; int n = 0;
ptr++; ptr++;
while(IS_DIGIT(*ptr)) while(IS_DIGIT(*ptr))
{
n = n * 10 + *ptr++ - CHAR_0; n = n * 10 + *ptr++ - CHAR_0;
if (*ptr != CHAR_RIGHT_PARENTHESIS) if (n > 255)
{ {
*errorcodeptr = ERR39; *errorcodeptr = ERR38;
goto FAILED; goto FAILED;
} }
if (n > 255) }
if (*ptr != CHAR_RIGHT_PARENTHESIS)
{ {
*errorcodeptr = ERR38; *errorcodeptr = ERR39;
goto FAILED; goto FAILED;
} }
*code++ = n; *code++ = n;
...@@ -7459,7 +7461,7 @@ for (;; ptr++) ...@@ -7459,7 +7461,7 @@ for (;; ptr++)
{ {
open_capitem *oc; open_capitem *oc;
recno = GET2(slot, 0); recno = GET2(slot, 0);
cd->backref_map |= (recno < 32)? (1 << recno) : 1; cd->backref_map |= (recno < 32)? (1U << recno) : 1;
if (recno > cd->top_backref) cd->top_backref = recno; if (recno > cd->top_backref) cd->top_backref = recno;
/* Check to see if this back reference is recursive, that it, it /* Check to see if this back reference is recursive, that it, it
...@@ -8070,7 +8072,7 @@ for (;; ptr++) ...@@ -8070,7 +8072,7 @@ for (;; ptr++)
item_hwm_offset = cd->hwm - cd->start_workspace; item_hwm_offset = cd->hwm - cd->start_workspace;
*code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF; *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
PUT2INC(code, 0, recno); PUT2INC(code, 0, recno);
cd->backref_map |= (recno < 32)? (1 << recno) : 1; cd->backref_map |= (recno < 32)? (1U << recno) : 1;
if (recno > cd->top_backref) cd->top_backref = recno; if (recno > cd->top_backref) cd->top_backref = recno;
/* Check to see if this back reference is recursive, that it, it /* Check to see if this back reference is recursive, that it, it
...@@ -8683,7 +8685,7 @@ do { ...@@ -8683,7 +8685,7 @@ do {
op == OP_SCBRA || op == OP_SCBRAPOS) op == OP_SCBRA || op == OP_SCBRAPOS)
{ {
int n = GET2(scode, 1+LINK_SIZE); int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1 << n) : 1); int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE; if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
} }
...@@ -8811,7 +8813,7 @@ do { ...@@ -8811,7 +8813,7 @@ do {
op == OP_SCBRA || op == OP_SCBRAPOS) op == OP_SCBRA || op == OP_SCBRAPOS)
{ {
int n = GET2(scode, 1+LINK_SIZE); int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1 << n) : 1); int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE; if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE;
} }
......
...@@ -3938,10 +3938,10 @@ static sljit_s32 character_to_int32(pcre_uchar chr) ...@@ -3938,10 +3938,10 @@ static sljit_s32 character_to_int32(pcre_uchar chr)
sljit_s32 value = (sljit_s32)chr; sljit_s32 value = (sljit_s32)chr;
#if defined COMPILE_PCRE8 #if defined COMPILE_PCRE8
#define SSE2_COMPARE_TYPE_INDEX 0 #define SSE2_COMPARE_TYPE_INDEX 0
return (value << 24) | (value << 16) | (value << 8) | value; return ((unsigned int)value << 24) | ((unsigned int)value << 16) | ((unsigned int)value << 8) | (unsigned int)value;
#elif defined COMPILE_PCRE16 #elif defined COMPILE_PCRE16
#define SSE2_COMPARE_TYPE_INDEX 1 #define SSE2_COMPARE_TYPE_INDEX 1
return (value << 16) | value; return ((unsigned int)value << 16) | value;
#elif defined COMPILE_PCRE32 #elif defined COMPILE_PCRE32
#define SSE2_COMPARE_TYPE_INDEX 2 #define SSE2_COMPARE_TYPE_INDEX 2
return value; return value;
...@@ -8507,7 +8507,7 @@ if (opcode == OP_ONCE) ...@@ -8507,7 +8507,7 @@ if (opcode == OP_ONCE)
/* We temporarily encode the needs_control_head in the lowest bit. /* We temporarily encode the needs_control_head in the lowest bit.
Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns
the same value for small signed numbers (including negative numbers). */ the same value for small signed numbers (including negative numbers). */
BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0); BACKTRACK_AS(bracket_backtrack)->u.framesize = ((unsigned int)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
} }
return cc + repeat_length; return cc + repeat_length;
} }
......
...@@ -66,7 +66,8 @@ Arg RE::no_arg((void*)NULL); ...@@ -66,7 +66,8 @@ Arg RE::no_arg((void*)NULL);
// inclusive test if we ever needed it. (Note that not only the // inclusive test if we ever needed it. (Note that not only the
// __attribute__ syntax, but also __USER_LABEL_PREFIX__, are // __attribute__ syntax, but also __USER_LABEL_PREFIX__, are
// gnu-specific.) // gnu-specific.)
#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__) && !defined(__INTEL_COMPILER) #if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__) \
&& !defined(__INTEL_COMPILER) && !defined(__LCC__)
# define ULP_AS_STRING(x) ULP_AS_STRING_INTERNAL(x) # define ULP_AS_STRING(x) ULP_AS_STRING_INTERNAL(x)
# define ULP_AS_STRING_INTERNAL(x) #x # define ULP_AS_STRING_INTERNAL(x) #x
# define USER_LABEL_PREFIX_STR ULP_AS_STRING(__USER_LABEL_PREFIX__) # define USER_LABEL_PREFIX_STR ULP_AS_STRING(__USER_LABEL_PREFIX__)
...@@ -91,6 +92,7 @@ static const char *start_options[] = { ...@@ -91,6 +92,7 @@ static const char *start_options[] = {
"(*LIMIT_RECURSION=", "(*LIMIT_RECURSION=",
"(*LIMIT_MATCH=", "(*LIMIT_MATCH=",
"(*CRLF)", "(*CRLF)",
"(*LF)",
"(*CR)", "(*CR)",
"(*BSR_UNICODE)", "(*BSR_UNICODE)",
"(*BSR_ANYCRLF)", "(*BSR_ANYCRLF)",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2018 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -298,6 +298,7 @@ if (preg->re_pcre == NULL) ...@@ -298,6 +298,7 @@ if (preg->re_pcre == NULL)
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, (void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
&re_nsub); &re_nsub);
preg->re_nsub = (size_t)re_nsub; preg->re_nsub = (size_t)re_nsub;
preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */
return 0; return 0;
} }
...@@ -335,8 +336,6 @@ if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL; ...@@ -335,8 +336,6 @@ if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL; if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY; if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY;
((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */
/* When no string data is being returned, or no vector has been passed in which /* When no string data is being returned, or no vector has been passed in which
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding
the return data is large enough. */ the return data is large enough. */
......
...@@ -500,7 +500,7 @@ enum { ...@@ -500,7 +500,7 @@ enum {
#if (defined (SUPPORT_PCRE8) + defined (SUPPORT_PCRE16) + \ #if (defined (SUPPORT_PCRE8) + defined (SUPPORT_PCRE16) + \
defined (SUPPORT_PCRE32)) >= 2 defined (SUPPORT_PCRE32)) >= 2
#define CHAR_SIZE (1 << pcre_mode) #define CHAR_SIZE (1U << pcre_mode)
/* There doesn't seem to be an easy way of writing these macros that can cope /* There doesn't seem to be an easy way of writing these macros that can cope
with the 3 pairs of bit sizes plus all three bit sizes. So just handle all the with the 3 pairs of bit sizes plus all three bit sizes. So just handle all the
...@@ -4443,7 +4443,7 @@ while (!done) ...@@ -4443,7 +4443,7 @@ while (!done)
/* If there is study data, write it. */ /* If there is study data, write it. */
if (extra != NULL) if (extra != NULL && (extra->flags & PCRE_EXTRA_STUDY_DATA) != 0)
{ {
if (fwrite(extra->study_data, 1, true_study_size, f) < if (fwrite(extra->study_data, 1, true_study_size, f) <
true_study_size) true_study_size)
...@@ -4735,7 +4735,7 @@ while (!done) ...@@ -4735,7 +4735,7 @@ while (!done)
if (isdigit(*p)) /* Set copy string */ if (isdigit(*p)) /* Set copy string */
{ {
while(isdigit(*p)) n = n * 10 + *p++ - '0'; while(isdigit(*p)) n = n * 10 + *p++ - '0';
copystrings |= 1 << n; copystrings |= 1U << n;
} }
else if (isalnum(*p)) else if (isalnum(*p))
{ {
...@@ -4798,7 +4798,7 @@ while (!done) ...@@ -4798,7 +4798,7 @@ while (!done)
if (isdigit(*p)) if (isdigit(*p))
{ {
while(isdigit(*p)) n = n * 10 + *p++ - '0'; while(isdigit(*p)) n = n * 10 + *p++ - '0';
getstrings |= 1 << n; getstrings |= 1U << n;
} }
else if (isalnum(*p)) else if (isalnum(*p))
{ {
...@@ -5335,7 +5335,7 @@ while (!done) ...@@ -5335,7 +5335,7 @@ while (!done)
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
if ((copystrings & (1 << i)) != 0) if ((copystrings & (1U << i)) != 0)
{ {
int rc; int rc;
char copybuffer[256]; char copybuffer[256];
...@@ -5400,7 +5400,7 @@ while (!done) ...@@ -5400,7 +5400,7 @@ while (!done)
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
if ((getstrings & (1 << i)) != 0) if ((getstrings & (1U << i)) != 0)
{ {
int rc; int rc;
const char *substring; const char *substring;
......
...@@ -1380,7 +1380,7 @@ ...@@ -1380,7 +1380,7 @@
1X 1X
123456\P 123456\P
//KF>testsavedregex //S-KF>testsavedregex
/abc/IS>testsavedregex /abc/IS>testsavedregex
<testsavedregex <testsavedregex
......
...@@ -5614,9 +5614,8 @@ No match ...@@ -5614,9 +5614,8 @@ No match
123456\P 123456\P
No match No match
//KF>testsavedregex //S-KF>testsavedregex
Compiled pattern written to testsavedregex Compiled pattern written to testsavedregex
Study data written to testsavedregex
/abc/IS>testsavedregex /abc/IS>testsavedregex
Capturing subpattern count = 0 Capturing subpattern count = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment