/* ... ck_entersub ......................................................... */
+STATIC int indirect_is_indirect(const indirect_op_info_t *moi, const indirect_op_info_t *ooi) {
+ if (moi->pos > ooi->pos)
+ return 0;
+
+ if (moi->pos == ooi->pos)
+ return moi->len == ooi->len && !memcmp(moi->buf, ooi->buf, moi->len);
+
+ return 1;
+}
+
STATIC OP *(*indirect_old_ck_entersub)(pTHX_ OP *) = 0;
STATIC OP *indirect_ck_entersub(pTHX_ OP *o) {
if (!(ooi && ooi->pos))
goto done;
- if (moi->pos < ooi->pos) {
+ if (indirect_is_indirect(moi, ooi)) {
SV *file;
dSP;
use strict;
use warnings;
-use Test::More tests => 52 * 4;
+use Test::More tests => 56 * 4;
my ($obj, $pkg, $cb, $x, @a);
our $y;
, bar
=> $obj );
####
+$obj = new->new;
+####
+$obj = new->new; # new new
+####
+$obj = new->newnew;
+####
+$obj = newnew->new;
+####
$obj = Hlagh->$cb;
####
$obj = Hlagh->$cb();
use strict;
use warnings;
-use Test::More tests => 50 * 6 + 2;
+use Test::More tests => 52 * 6 + 2;
my ($obj, $x);
our ($y, $bloop);
sub expect {
my ($pkg) = @_;
qr/^warn:Indirect\s+call\s+of\s+method\s+
- "(?:new|meh|$pkg$pkg)"
+ "(?:new|meh|feh|$pkg$pkg)"
\s+on\s+object\s+
- "(?:$pkg|newnew|\$(?:[xyz_\$]|(?:sploosh::)?sploosh|(?:main::)?bloop))"
+ "(?:$pkg|newnew|feh|\$(?:[xyz_\$]|(?:sploosh::)?sploosh|(?:main::)?bloop))"
\s+at\s+\(eval\s+\d+\)\s+line\s+\d+
/x
}
####
$obj = new newnew; # new newnew
####
+$obj = feh feh;
+####
+$obj = feh feh; # feh feh
+####
new Hlagh (meh $x)
####
Hlagh->new(meh $x)