-
Notifications
You must be signed in to change notification settings - Fork 581
BBC Commit 73b9584 breaks Roman::Unicode #16915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @khwilliamsonThe commit involved moving user-defined properties into core. It is a |
From @khwilliamsonOn Sun, 31 Mar 2019 21:50:32 -0700, public@khwilliamson.com wrote:
I wrote this ticket with the system perl info instead of blead's. But it is actually irrelevant. Tony Cook++ tracked down the cause of this for me. The stack needed to pushed/popped around the call to the user-defined perl subroutine. But then he wanted to see what the code this replaces does, and it turns out it does several more things, which are similar to what the code block regex code does, which is similar to what other places do that call out to perl code. But not exact So is it a bug that for code blocks, there is no SAVEHINTS, or that it pushes (the undocumented) PERLSI_REQUIRE instead of (the undocumented) PERLSI_MAGIC? And when should one use save_re_context()? My guess is that SAVETMPS and FREETMPS are just niceties, but I don't know. None of this is obvious to me. My guess is that the disparities in calling things are actually bugs, and there should be a routine that standardizes things, or at least documentation as to what to do. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sun, 31 Mar 2019 22:12:02 -0700, khw wrote:
They're required because you're doing something unusual - calling a perl sub while compiling a regular expression, *or* while matching[1] a regular expression. For compile-time the SAVEHINTS is required so that changes to $^H or %^H don't result in lexical changes to the code being compiled (like turning off strict.) The PUSHSTACK is needed because the code seems to be called from places that don't expect the stack to move. I'm not sure exactly where that is in this case, but it's an issue for various types of magic, eg. pv = SvPV(somesv); /* can call get or overload magic */ but since that's the uncommon case it's best to optimize for magic not being called and put the magic code through the extra work of switching stacks. The re_save_context() is more a run-time issue, so that the code you call doesn't modify $1 etc from underneath the caller. All that said, I don't know that I would have realized this was necessary if I was writing the code. Tony [1] IIRC from a #p5p conversation a while back, the user sub can be called at runtime if it wasn't defined at regular expression compile-time. It did appear to be called at runtime when I was debugging this issue. |
From @iabynOn Mon, Apr 01, 2019 at 04:34:33PM -0700, Tony Cook via RT wrote:
Basically what Tony says below.
Yeah, I think the "stack-of-stacks" mechanism was introduced when it was
s/re_save_context/save_re_context/ I remember save_re_context() being a bit of a hack, but can't remember
The regex code-block calling mechanism (?{...}) is very specialised, In general, when calling code you should do ENTER/LEAVE and -- |
From @khwilliamsonOn 4/3/19 4:39 AM, Dave Mitchell wrote:
The code in swash_init has this: /* We might get here via a subroutine signature which uses a utf8 I'm wondering if that could affect code blocks |
From @iabynOn Wed, Apr 10, 2019 at 03:21:21PM -0600, Karl Williamson wrote:
PL_subname is the name of the currently-compiling sub, so I can't really -- |
From @khwilliamsonThe module now tests OK, so removing from blockers list. I still need to write a test so keeping the ticket open |
@khwilliamson Have you written the test indicated above? If so, is this ticket closable? Thank you very much. |
I think we can resolve this ticket and open a ticket for the test we want to write. I don't consider this a blocker anymore since the BBC tests pass. Any strong objections? |
I'm afraid I can't remember what test I was supposed to write, nor do I see any guidance in the ticket. But, since then, there have been a bunch of tests written exercising this area of the code. So I am closing the ticket |
Migrated from rt.perl.org#133970 (status was 'open')
Searchable as RT133970$
The text was updated successfully, but these errors were encountered: