X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Upper.xs;h=5bf3b496797c67bf67de422a6679e78e27382f3d;hb=965e21f781c23f8c20242d17d7db745d8c035eb3;hp=ba8b7b4a53cf5599d9fb561482f42039d60e4514;hpb=2315578c2990170a7aad20f8a15f715e4b2be5ef;p=perl%2Fmodules%2FScope-Upper.git diff --git a/Upper.xs b/Upper.xs index ba8b7b4..5bf3b49 100644 --- a/Upper.xs +++ b/Upper.xs @@ -1031,11 +1031,17 @@ PREINIT: I32 cxix; su_ud_localize *ud; CODE: + if (SvTYPE(sv) >= SVt_PVGV) + croak("Can't infer the element localization type from a glob and the value"); SU_GET_CONTEXT(3, 3); Newx(ud, 1, su_ud_localize); SU_UD_ORIGIN(ud) = NULL; SU_UD_HANDLER(ud) = su_localize; su_ud_localize_init(ud, sv, val, elem); + if (ud->type != SVt_PVAV && ud->type != SVt_PVHV) { + Safefree(ud); + croak("Can't localize an element of something that isn't an array or a hash"); + } su_init(cxix, ud, 4); void