| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
These were missed in commit 1203306491d341ed, which renamed ptr to key.
|
|
|
|
|
|
|
|
|
|
|
| |
As seen in [perl #114242], the TryCatch test suite triggers this bug.
lex_grow_linestr() was reallocing the PL_linestr buffer and updating all
pointers within it, but was failing to update
PL_sublex_info.re_eval_start.
Unfortunately, lex_grow_linestr() doesn't seem to be used in core outside
of hereto docs, and due to a separate parser bug, hereto docs can't
currently be used within /(?{})/, so I can't add tests for it yet.
|
| |
|
|
|
|
|
|
| |
Commit 9f653bb54868b8547466924d4ce483acb8987efb changed the docs from
New/Newz to the newer Newx/Newxz, but forgot to remove the
no-longer-present 'id' arg.
|
|\ |
|
| | |
|
| |
| |
| |
| | |
Previously only those matching qr/GVf_IMPORTED/ were exposed.
|
| |
| |
| |
| |
| |
| | |
Previously most were exposed as constants, but often B was not taught about
flags added to cv.h. Determining the flags by parsing cv.h also permits the
removal of various version-specific logic from the Makefile.PL
|
| |
| |
| |
| | |
Previously only a subset were exposed as constants.
|
|/
|
|
|
|
| |
It doesn't actually matter which order the files are scanned for constants,
but it's neater and slightly clearer where to add new files if there is an
obvious order.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This was fixed as a side effect of other patches, so no tests were
created at the time.
|
| |
|
| |
|
|
|
|
|
| |
The regexp for the 'eval BLOCK' test should match explicit '...'.
So avoid the \{ issue and put \Q before all the punctuation.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This warning was being generated inappropriately during some internal
operations, such as parsing a program; spotted by Tom Christiansen.
The solution is to move the check for this situation out of the common
code, and into the code where just \p{} and \P{} are handled.
As mentioned in the commit's perldelta, there remains a bug
[perl #114148], where no warning gets generated when it should
|
|
|
|
|
|
| |
Future commits will use this functionality in additional places beyond
the single one currently. It makes sense to abstract it into a
function.
|
|
|
|
|
|
|
| |
Previously, this flag was not looked at in pass 1, but future commits
will require it to be. The regnode is not actually allocated in pass1,
so set a local variable with the value, and set the flag in the regnode
after everything affecting the flag is done.
|
|
|
|
|
|
| |
This commit separates out the building up of code points that match the
posix properties (including \w, \d, \s) from those that match Unicode
properties. This will prove useful in future commits
|
|
|
|
| |
It's a little clearer to use boolean for a true/false valued variable
|
|
|
|
|
|
|
| |
This creates a function to hide some of the internal details of swashes
from the regex engine, which is the only authorized user, enforced
through #ifdefs in embed.fnc. These work closely together, but it's
best to have a clean interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There have been two flavors of ANYOF nodes under /l (locale) (for
bracketed character classes). If a class didn't try to match things
like [:word:], it was smaller by 4 bytes than one that did.
A flag bit was used to indicate which size it was. By making all such
nodes the larger size, whether needed or not, that bit can be freed to
be used for other purposes.
This only affects ANYOF nodes compiled under locale rules. The hope is
to eventually git rid of these nodes anyway, by taking the suggestion of
Yves Orton to compile regular expressions using the current locale, and
automatically recompile the next time they are used after the locale
changes.
This commit is somewhat experimental, done early in the development
cycle to see if there are any breakages. There are other ways to free
up a bit, as explained in the comments. Best would be to split off
nodes that match everything outside Latin1, freeing up the
ANYOF_UNICODE_ALL bit. However, there currently would need to be two
flavors of this, one also for ANYOFV. I'm currently working to
eliminate the need for ANYOFV nodes (which aren't sufficient,
[perl #89774]), so it's easiest to wait for this work to be done before
doing the split, after which we can revert this change in order to gain
back the space, but in the meantime, this will have had the opportunity
to smoke out issues that I would like to know about.
|
| |
|
| |
|
|
|
|
|
| |
I was confused by the earlier documentation. Thanks to Leon Timmermans
for clarifying, and to Vicent Pitt for most of the wording
|
|
|
|
| |
since the number of tests is known in advance.
|
| |
|
|
|
|
|
|
|
|
|
| |
This will reduce the machine code size on Visual C Perl, by removing C stack
clean up opcodes and possible jmp opcodes after croak() and similar
functions. Perl's existing __attribute__noreturn__ macro (and therefore
GCC's __attribute__((noreturn)) ) is fundamentally incompatible with MS's
implementation for noreturn functions. win32.h already has _MSC_VER
aware code blocks, so adding more isn't a problem.
|
| |
|
|
|
|
|
| |
Cygwin fsync() is implemented in terms of the Win32 FlushFileBuffers()
API which requires GENERIC_WRITE access.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In restore_magic(), which is called after any magic processing, all of
the public OK flags have been shifted into the private OK flags. Thus
the lack of an appropriate public OK flags was used to trigger both get
magic and required conversions. This scheme did not cover ROK, however,
so all properly written code had to make sure mg_get was called the right
number of times anyway. Meanwhile the private OK flags gained a second
purpose of marking converted but non-authoritative values (e.g. the IV
conversion of an NV), and the inadequate flag shift mechanic broke this
in some cases.
This patch removes the shift mechanic for magic flags, thus exposing (and
fixing) some improper usage of magic SVs in which mg_get() was not called
correctly. It also has the side effect of making magic get functions
specifically set their SVs to undef if that is desired, as the new behavior
of empty get functions is to leave the value unchanged. This is a feature,
as now get magic that does not modify its value, e.g. tainting, does not
have to be special cased.
The changes to cpan/ here are only temporary, for development only, to
keep blead working until upstream applies them (or something like them).
Thanks to Rik and Father C for review input.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This was an early attempt to fix leaking of ops after syntax errors,
disabled because it was deemed to fragile. The new slab allocator
(8be227a) has solved this problem another way, so latefree(d) no
longer serves any purpose.
|
|
|
|
|
|
|
|
| |
It is not necessary for the op containing the sv containing the name
of the package to last until the end of the block. Perl_package can
free the op immediately, as the only information it needs from it it
copies to the sv in PL_curstname. The version number can be treated
the same way.
|
|
|
|
|
| |
It calls ck_fun, which applies list context to all the arguments,
since grepstart and mapstart have an L in regen/opcodes.
|
|
|
|
|
| |
The branch in question is only reached when it is called from ck_grep,
which itself calls LINKLIST on exactly the same op.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ck_grep is a tangled mess and I am trying to simplify it, but at each
step it is not at all obvious what is happening.
grep/map with a block starts out like this:
grepstart
pushmark
null
scope/leave
block contents...
arg1
arg2
...
The if (o->op_flags & OPf_STACKED) at the top of ck_grep runs for
blocks. The firstkid var refers to the null above, and gets its
op_next set (this code was in ck_sort until recently [ck_grep used to
call ck_sort], and this particular op_next assignment was specific to
grep and map).
Later, the thing is fed through ck_fun, whose OA_CVREF case transforms
the tree into this:
grepstart
pushmark
null ← new op
null ← original null
scope/leave
block contents...
arg1
arg2
...
Then cUNOPx(cLISTOP->op_first->op_sibling)->op_first gets its op_next
set. By that point, that expression refers to the original null op,
so setting its op_next pointer to begin with seems pointless.
But it is not actually pointless. Removing that statement breaks
things. It turns out, as usual, that everything is more complicated
than it seems. Setting kid->op_next = (OP*)gwop in the block-specific
if statement after setting the first null op’s op_next pointer results
in op_next pointers like this (the newly-created grepwhile doesn’t
link to the grepstart yet at this point):
[grepwhile]
grepstart
pushmark
null -> block contents
scope/leave -> grepwhile
block contents...
arg1
arg2
...
So ck_fun’s OA_CVREF handling, when it calls LINKLIST, sees that the
original null op already has its op_next set and does nothing. With-
out it set, it copies it from the first kid, resulting in this (when
LINKLIST copies the op_next pointer out, it makes the kid it was cop-
ied from point to its sibling or its parent):
[grepwhile]
grepstart
pushmark
null
null -> grepwhile
scope/leave -> null (prev line)
block contents...
arg1
arg2
...
That nonsensical arrangement of op_next pointers basically prevents
the block from running, because the grepwhile’s other pointer, copied
from the first null’s kid, ends up pointing to the grepwhile itself.
If we also remove the kid->op_next = (OP*)gwop assignment from the
if(OPf_STACKED) block, then we end up with this after ck_fun:
[grepwhile]
grepstart
pushmark
null
null -> first op in block
scope/leave -> null (prev line)
block contents...
arg1
arg2
...
Then the op_next poiner from the first null’s kid is copied to
grepwhile’s op_other pointer, and everything works.
This also means we can remove the now-redundant LINKLIST call from the
if(OPfSTACKED) block, since ck_fun’s OA_CVREF handling also does that.
So now every vestige of the original call to ck_sort is gone.
This also means we no longer have to repeat NewOp(1101, gwop...).
|