r925 breaks use NAME VERSION;

$ ~/Sandpit/589g/bin/perl -d:NYTProf -e 'use strict 0.01'
$ ~/Sandpit/589g/bin/nytprofhtml 
Generating report...
Reading nytprof.out
Writing report to nytprof directory
Can't call method "eval_fid" on an undefined value at 
/home/nclark/Sandpit/589g/lib/perl5/site_perl/5.8.9/i686-linux/Devel/NYTProf/Data.pm
 line 685.

It's this diff to Devel::NYTProf::Data

http://code.google.com/p/perl-devel-nytprof/source/diff?spec=svn925&r=925&format=side&path=/trunk/lib/Devel/NYTProf/Data.pm

The routine in question is now:

sub file_line_range_of_sub {
    my ($self, $sub) = @_;

    my $sub_subinfo = $self->{sub_subinfo}{$sub}
        or return;    # no such sub
    my ($fid, $first, $last) = @$sub_subinfo;

    my $fileinfo = $fid && $self->{fid_fileinfo}->[$fid];
    while ($fileinfo->eval_fid) {

        # eg string eval
        # eg [ "(eval 6)[/usr/local/perl58-i/lib/5.8.6/Benchmark.pm:634]", 2, 
634 ]
        warn sprintf "file_line_range_of_sub: %s: fid %d -> %d for %s\n",
                $sub, $fid, $fileinfo->eval_fid, $fileinfo->filename
            if $trace;
        $first = $last = $fileinfo->eval_line if 1;    # XXX control via param?

        # follow next link in chain
        my $outer_fid = $fileinfo->eval_fid;
        $fileinfo = $self->{fid_fileinfo}->[$outer_fid];
    }

    return ($fileinfo->filename, $fid, $first, $last);
}


$fid happens to be undef here.

I'm not certain what the right fix is. I don't know if the "obvious" fix is
correct, or merely hiding the symptoms.

Nicholas Clark

-- 
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to