In perl.git, the branch smoke-me/khw-regcomp has been created
<http://perl5.git.perl.org/perl.git/commitdiff/e063d6f9e593a6fa1345a055b214296df85fed43?hp=0000000000000000000000000000000000000000>
at e063d6f9e593a6fa1345a055b214296df85fed43 (commit)
- Log -----------------------------------------------------------------
commit e063d6f9e593a6fa1345a055b214296df85fed43
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 20:52:50 2015 -0700
PATCH: [perl #126261: Assertion failure on missing [ in qr//
This is the result of the regex compiler creating a temporary buffer to
parse a portion of the input pattern, and then when an error or warning
occurs in that buffer, trying to use addresses both inside it and the
original pattern.
The solution here is a general one, that confines the heavy lifting to
one macro, plus a little setup and tear-down around the temporary buffer
use. The comments in the code detail how we relate the address of the
error in the temporary back to the parallel address in the input
pattern.
M regcomp.c
M t/lib/warnings/regcomp
commit 8923b5ab2080c6f16cc07b49a10ed865ffc5c9c3
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 20:38:14 2015 -0700
regcomp.c: update RExC_start when parsing outside input
I noticed this while code reading. In places, regcomp parses not the
input pattern but a temporary buffer it constructs, based on that input
pattern. RExC_start should be updated so it always is pointing to the
same buffer as the parse pointer; otherwise segfaults can happen.
I have no idea how one currently can get into the situation this
protects against, so there are no tests added.
M regcomp.c
commit ee59409bc17f456525c5f9597ed8cdd51865dcf0
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 18:26:37 2015 -0700
regcomp.c: Add a stable pattern end pointer.
RExC_end is set sometimes during pattern compilation to perhaps another
string in memory. Messages are output based on the original string, so
create an end pointer that is in terms of that original string,
otherwise could get segfaults.
M regcomp.c
commit 1531be659ea923113f442d62f019f15cdea2f4da
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 18:18:36 2015 -0700
t/lib/warnings/regcomp: Fix typo in comment
M t/lib/warnings/regcomp
commit 536022553973999ad099fa6392cf01a2e5f183b3
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 17:56:13 2015 -0700
regcomp.c: Use macro instead of recalculating
There is a macro that does the job that this code does. Use it.
M regcomp.c
commit 342e76dd7544297cc5622c04c216c01eb8818aa3
Author: Karl Williamson <[email protected]>
Date: Sun Dec 20 21:48:04 2015 -0700
regcomp.c: Move calculations to common macro
This consolidates identical calculations into a single place, which
makes things easier to maintain.
Probably the reason they previously werent, is because now the common
macro has to evaluate the same expression more than once. Since the
macro is used to return a list, it can't be turned into a single
statement.
Any decent optimizing compiler will extract the common subexpressions
and evaluate them just once. But even if not, the macro is called only
in the event of a fatal error, in which case speed is not important, or
to raise a warning, which we expect to be rare, and the extra work is
negligible in comparison with what is needed to output the message.
M regcomp.c
commit 696d4827baa036734dd132a617e97317813e79e3
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 13:37:20 2015 -0700
regcomp.h: reword some comments
M regcomp.h
commit 1e05d5d4e44732972d5f6cbe10bb5c5a335c0e62
Author: Karl Williamson <[email protected]>
Date: Mon Dec 21 14:47:05 2015 -0700
regcomp.c: Make some params to a static fcn const
This is just acting on the TODO comment.
M embed.fnc
M proto.h
M regcomp.c
commit 53cce840fea9603812a3a0c127b7c24a01b58d25
Author: Karl Williamson <[email protected]>
Date: Thu Nov 19 20:51:04 2015 -0700
regcomp.c: Add 2 basic assertions
These should be true because an SV* should always have a trailing NUL,
but a lot of things in this code depend on it. It's worthwhile to point
that out; I wasn't sure it was true until I investigated. And an
assert() makes sure it is really true
M regcomp.c
commit a04a9beb1adda04f992e1ebf415ac1a31ac4850e
Author: Karl Williamson <[email protected]>
Date: Tue Oct 20 22:23:00 2015 -0600
pp_hot.c: Add assertion
This will make the cause of any future failures more clear.
M pp_hot.c
commit eb8b2661f93e0466fbe10d8fe377c06174818ebf
Author: Karl Williamson <[email protected]>
Date: Tue Oct 20 22:21:42 2015 -0600
perlapi: Clarify 'string' vs. buffer
A string strictly is NUL terminated, but our terminology is lax
M autodoc.pl
M handy.h
commit e585b907bb6b845971d7ab3279baf882df3fa2a3
Author: Karl Williamson <[email protected]>
Date: Tue Oct 20 22:08:59 2015 -0600
utf8.h: Add 2 assertions
This makes sure in DEBUGGING builds that the macro is called correctly.
M utf8.h
commit f4b427a610aa39052422029f206330e4e894af29
Author: Karl Williamson <[email protected]>
Date: Fri Sep 11 12:37:27 2015 -0600
test.pl
M t/test.pl
-----------------------------------------------------------------------
--
Perl5 Master Repository