From: Florian Ragwitz Date: Wed, 5 Nov 2008 23:55:50 +0000 (+0000) Subject: Make things work within evals with a hint hash. X-Git-Tag: 0.005000~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c93bc23ea1220e8b6c6e8ca1dad2ba32db788c06;p=p5sagit%2FDevel-Declare.git Make things work within evals with a hint hash. --- diff --git a/Declare.xs b/Declare.xs index ea72a80..635d946 100644 --- a/Declare.xs +++ b/Declare.xs @@ -256,9 +256,16 @@ STATIC OP *dd_ck_rv2cv(pTHX_ OP *o, void *user_data) { OP* dd_pp_entereval(pTHX) { dSP; - dPOPss; STRLEN len; const char* s; + SV *sv; +#ifdef PERL_5_9_PLUS + SV *saved_hh; + if (PL_op->op_private & OPpEVAL_HAS_HH) { + saved_hh = POPs; + } +#endif + sv = POPs; if (SvPOK(sv)) { if (dd_debug) { printf("mangling eval sv\n"); @@ -275,6 +282,11 @@ OP* dd_pp_entereval(pTHX) { SvGROW(sv, 8192); } PUSHs(sv); +#ifdef PERL_5_9_PLUS + if (PL_op->op_private & OPpEVAL_HAS_HH) { + PUSHs(saved_hh); + } +#endif return PL_ppaddr[OP_ENTEREVAL](aTHX); }