Permalink
Browse files

printf "%vd", "version" should not SEGV

See perl #102586.
  • Loading branch information...
1 parent e628fd8 commit 47a0660e68fc38d8d2ff11855d0d5fa5e2af0b82 Father Chrysostomos committed Nov 23, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −1 sv.c
  2. +1 −0 t/op/sprintf.t
View
2 sv.c
@@ -10343,7 +10343,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen,
* back into v-string notation and then let the
* vectorize happen normally
*/
- if (sv_derived_from(vecsv, "version")) {
+ if (sv_derived_from(vecsv, "version") && SvROK(vecsv)) {
char *version = savesvpv(vecsv);
if ( hv_exists(MUTABLE_HV(SvRV(vecsv)), "alpha", 5 ) ) {
Perl_warner(aTHX_ packWARN(WARN_INTERNAL),
View
1 t/op/sprintf.t
@@ -710,3 +710,4 @@ __END__
>%v.*X< >[3, '012']< >030.031.032< >perl #83194: vector flag + dynamic precision<
>%*v.3X< >[':', '012']< >030:031:032< >perl #83194: vector flag + custom separator + static precision<
>%*v.*X< >[':', 3, '012']< >030:031:032< >perl #83194: vector flag + custom separator + dynamic precision<
+>%vd< >"version"< >118.101.114.115.105.111.110< >perl #102586: vector flag + "version"<

0 comments on commit 47a0660

Please sign in to comment.