X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Upper.xs;h=75c50934fa9abb290200ffc25dd5a496dde41346;hb=59a1136cba8ac79b0428d55824873b55a9b700aa;hp=5bf3b496797c67bf67de422a6679e78e27382f3d;hpb=965e21f781c23f8c20242d17d7db745d8c035eb3;p=perl%2Fmodules%2FScope-Upper.git diff --git a/Upper.xs b/Upper.xs index 5bf3b49..75c5093 100644 --- a/Upper.xs +++ b/Upper.xs @@ -380,6 +380,9 @@ STATIC void su_ud_localize_init(pTHX_ su_ud_localize *ud, SV *sv, SV *val, SV *e t = SvTYPE(SvRV(val)); deref = 1; } + } else if (SvROK(sv)) { + croak("Invalid %s reference as the localization target", + sv_reftype(SvRV(sv), 0)); } else { STRLEN len, l; const char *p = SvPV_const(sv, len), *s;