I've been looking at the DProf bug Ilya pointed out a few weeks ago and I'm
stumped. What part of pp_entersub is checking that a function was called
like this:
&bar;
and not like this?
&bar(@_);
Here's a reduction of Ilya's bug report:
&foo1( A );
&foo2( B );
sub foo1 {
print "foo1(@_)\n";
bar(@_); # okay
}
sub foo2 {
print "foo2(@_)\n";
&bar; # not okay
}
sub bar {
print "bar(@_)\n";
}
DProf is loosing @_ when &bar is called from &foo2. Here's what DProf does:
XS(XS_DB_sub)
{
dXSARGS;
dORIGMARK;
SP -= items;
DBG_SUB_NOTIFY( "XS DBsub(%s)\n", SvPV(Sub, na) );
sv_setiv( DBsingle, 0 ); /* disable DB single-stepping */
prof_mark( OP_ENTERSUB );
PUSHMARK( ORIGMARK );
perl_call_sv( Sub, GIMME );
prof_mark( OP_LEAVESUB );
SPAGAIN;
PUTBACK;
return;
}
I've tried skipping the PUSHMARK at the point when &bar is about to be
called from &foo2 but that didn't change the results (I was guessing). If
anyone has some ideas to share, I'll take 'em.
Dean
stumped. What part of pp_entersub is checking that a function was called
like this:
&bar;
and not like this?
&bar(@_);
Here's a reduction of Ilya's bug report:
&foo1( A );
&foo2( B );
sub foo1 {
print "foo1(@_)\n";
bar(@_); # okay
}
sub foo2 {
print "foo2(@_)\n";
&bar; # not okay
}
sub bar {
print "bar(@_)\n";
}
DProf is loosing @_ when &bar is called from &foo2. Here's what DProf does:
XS(XS_DB_sub)
{
dXSARGS;
dORIGMARK;
SP -= items;
DBG_SUB_NOTIFY( "XS DBsub(%s)\n", SvPV(Sub, na) );
sv_setiv( DBsingle, 0 ); /* disable DB single-stepping */
prof_mark( OP_ENTERSUB );
PUSHMARK( ORIGMARK );
perl_call_sv( Sub, GIMME );
prof_mark( OP_LEAVESUB );
SPAGAIN;
PUTBACK;
return;
}
I've tried skipping the PUSHMARK at the point when &bar is about to be
called from &foo2 but that didn't change the results (I was guessing). If
anyone has some ideas to share, I'll take 'em.
Dean