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
sv_vcatpvfn() fails on some (very limited) situations #7976
Comments
From ikegami@artemis.a01.aist.go.jpThis is a bug report for perl from ikegami@ni.aist.go.jp, When Perl 5.8.7 is compiled without -DUSE_LONG_DOUBLE, an API call Inline Patch--- sv.c.orig Thu Jun 16 22:26:21 2005
+++ sv.c Thu Jun 16 22:27:33 2005
@@ -8403,7 +8403,7 @@
pp = pat + 2;
while (*pp >= '0' && *pp <= '9')
digits = 10 * digits + (*pp++ - '0');
- if (pp - pat == (int)patlen - 1) {
+ if (pp - pat == (int)patlen - 1 && (*pp == 'g' || !digits)) {
NV nv;
if (args)
-----------------------------------------------------------------
---
Site configuration information for perl v5.8.7: Configured by ikegami at Wed Jun 15 17:01:05 JST 2005. Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Locally applied patches: @INC for perl v5.8.7: Environment for perl v5.8.7: |
From @hvds"ikegami@artemis.a01.aist.go.jp (via RT)" <perlbug-followup@perl.org> wrote: There are in fact several ways we can fall through to the standard code I'm not sure how we can fix the other cases though, since we need to get I guess it might be possible to introduce an additional flag "I've In the meantime, the patch below might be useful for testing, and Hmm, I wonder how portable it would be to save a va_list* pointer and Hugo Inline Patch--- sv.c.old Mon Mar 21 10:06:39 2005
+++ sv.c Thu Jun 16 15:21:44 2005
@@ -9239,6 +9239,7 @@
return;
}
}
+ Perl_croak(aTHX_ "panic: unsafe fallthrough from /%.\d+[fg]/ optimisation");
}
}
#endif /* !USE_LONG_DOUBLE */ |
The RT System itself - Status changed from 'new' to 'open' |
From @rgshv@crypt.org wrote:
A warning ?
Scary.
|
From @hvdsRafael Garcia-Suarez <rgarciasuarez@mandriva.com> wrote: I guess a mandatory warning, and return an empty string - falling through Hugo |
From t-ikegami@aist.go.jpFrom: "Hugo van der Sanden via RT" <perlbug-followup@perl.org>
Oops. I've overlooked the case 'g'. For the time being, I'll skip thanks, |
From @hvdsTsutomu IKEGAMI <t-ikegami@aist.go.jp> wrote: Good, that's a much better solution than anything I suggested. Hugo |
From @rgarciaOn 6/17/05, hv wrote:
I'm not 100% sure what you meant, is the following correct ? : ==== //depot/perl/sv.c#922 - /opt/bleadperl/p4/perl/sv.c ==== Inline Patch--- /home/rafael/tmp/tmp.19047.0 2005-06-20 23:39:44.024671048 +0200
+++ /opt/bleadperl/p4/perl/sv.c 2005-06-20 23:37:49.390098152 +0200
@@ -8847,7 +8847,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
#ifndef USE_LONG_DOUBLE
/* special-case "%.<number>[gf]" */
- if ( patlen <= 5 && pat[0] == '%' && pat[1] == '.'
+ if ( !args && patlen <= 5 && pat[0] == '%' && pat[1] == '.'
&& (pat[patlen-1] == 'g' || pat[patlen-1] == 'f') ) {
unsigned digits = 0;
const char *pp;
@@ -8858,9 +8858,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
if (pp - pat == (int)patlen - 1) {
NV nv;
- if (args)
- nv = (NV)va_arg(*args, double);
- else if (svix < svmax)
+ if (svix < svmax)
nv = SvNV(*svargs);
else
return; |
From @hvdsRafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote: Yes. Hugo |
From @rgshv@crypt.org wrote:
OK, I thus applied it to bleadperl as change #24916. |
@rgs - Status changed from 'open' to 'resolved' |
From t-ikegami@aist.go.jpFrom: "Rafael Garcia-Suarez via RT" <perlbug-followup@perl.org>
That's what I'm using now. truly, |
Migrated from rt.perl.org#36310 (status was 'resolved')
Searchable as RT36310$
The text was updated successfully, but these errors were encountered: