On Fri, Dec 31, 2004 at 03:04:49PM +0000, hv@crypt.org wrote: > Nicholas Clark <nick@ccl4.org> wrote: > :The appended patch seems to cure the problem for me, but I'm not confident > :that it's the correct way. > > I notice that this changes the order things are stacked; I'm not sure if > that's ever going to be relevant. In particularly this swaps the first > two of the sequence: > PUSHSTACKi; ENTER; LEAVE; POPSTACK > .. but I'm not sure what they all do without expanding a lot of macros. Aha. I was rather hoping that someone would be able to tell me if the changes were going to be relevant. The "simplest" fix appears to be add save_re_context(); after the ENTER in if (!gv_fetchmeth(stash, "SWASHNEW", 8, -1)) { /* demand load utf8 */ ENTER; errsv_save = newSVsv(ERRSV); Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn(pkg,pkg_len), Nullsv); if (!SvTRUE(ERRSV)) sv_setsv(ERRSV, errsv_save); SvREFCNT_dec(errsv_save); LEAVE; } except that seems to be wasteful, as it would mean doing all the save work twice, because of the existing save_re_context() later in Perl_swatch_init. I was hoping that there was a good way to save the regexp engine's context just once for the entire function. Nicholas ClarkThread Previous