Sigh. I hate replying to myself, but there you go. That patch isn't
correct, because sv_reftype( root , 0 ) is always returning REF. Which
confused me, because the test passes. After digging, I'm now even _more_
confused - the XS stash is using gv_fetchmethod_autoload to get a method
to call, unlike the perl stash, which is just evalling the call, so the
only time the XS code I'm patching below will get called correctly is if
there's an AUTOLOAD in a package, that is then throwing an exception
crafted to look exactly like the perl 'missing objet method' exception.
Which seems like a rare case. Presumably 90% of the times it's getting
called _now_ are wrong, because something else is throwing missing
object method exceptions.
Anyway, it should be HvNAME( stash ), that does the right thing. But
more tests are clearly needed here.
Tom Insam wrote:
- if (SvROK(ERRSV) || !strstr(SvPV(ERRSV, PL_na),
- "Can't locate object method")) {
+ snprintf(errormatch, sizeof(errormatch),
+ "Can't locate object method \"%s\" via package \"%s\"",
+ item, sv_reftype( root , 0 ) );
+ if (SvROK(ERRSV) || !strstr(SvPV(ERRSV, PL_na), errormatch) ) {
die_object(aTHX_ ERRSV);
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates