--- Compress-LZF/LZF.xs 2007/04/16 20:05:33 1.24 +++ Compress-LZF/LZF.xs 2008/09/22 02:15:43 1.26 @@ -285,9 +285,14 @@ && SvTYPE(sv) != SVt_PVMG)) /* mstore */ { int deref = !SvROK (sv); + char *pv; if (!storable_mstore) - need_storable (); + { + PUTBACK; + need_storable (); + SPAGAIN; + } if (deref) sv = newRV_noinc (sv); @@ -302,11 +307,12 @@ SPAGAIN; sv = POPs; + pv = SvPV_nolen (sv); - if (SvPVX (sv)[0] == MAGIC_R) + if (*pv == MAGIC_R) { if (deref) - SvPVX (sv)[0] = MAGIC_R_deref; + *pv = MAGIC_R_deref; } else { @@ -365,7 +371,11 @@ sv_chop (sv, SvPVX (sv) + 2); if (!storable_mstore) - need_storable (); + { + PUTBACK; + need_storable (); + SPAGAIN; + } PUSHMARK (SP); XPUSHs (sv); @@ -409,7 +419,11 @@ case MAGIC_R: handle_MAGIC_R: if (!storable_mstore) - need_storable (); + { + PUTBACK; + need_storable (); + SPAGAIN; + } PUSHMARK (SP); XPUSHs (sv);