Applied patche fixes problem described above
+ if( orig_sp -list_mark < 0 ) break;
Also tests are fixed because new perl make optimization of my( $x, @list ) into padrange
+my @padav
...
+padrange
also new OP 'srefgen' is seen in modern perl
+ if ( ($op->name eq 'refgen' || $op->name eq 'srefgen') and @refgen_args < 2 ) {
Some tests lack && operator:
+if ( foo() && bar() || foo() ) {
From b0b8872621a000aa8d2d7279dae462873d0d85da Mon Sep 17 00:00:00 2001
From: Eugen Konkov <kes-kes@yandex.ru>
Date: Fri, 3 Mar 2017 21:09:57 +0200
Subject: [PATCH] New perl provide new OPs and do some optimizations
---
Trace.xs | 2 ++
t/07perl_Hook.t | 7 ++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Trace.xs b/Trace.xs
index c4be0b7..4ddc9dd 100644
--- a/Trace.xs
+++ b/Trace.xs
@@ -246,6 +246,8 @@ Runops_Trace_perl (pTHX) {
case ARITY_LIST:
list_mark = PL_stack_base + *(PL_markstack_ptr-1) + 1;
/* repeat stack from the op's mark to SP just before we started pushing */
+ if( orig_sp -list_mark < 0 ) break;
+
EXTEND(SP, orig_sp - list_mark);
while ( list_mark <= orig_sp ) {
XPUSHREF(*list_mark++);
diff --git a/t/07perl_Hook.t b/t/07perl_Hook.t
index 77d85fe..d23de61 100644
--- a/t/07perl_Hook.t
+++ b/t/07perl_Hook.t
@@ -15,7 +15,7 @@ Runops::Trace::set_tracer(sub {
$called++;
- if ( $op->name eq 'refgen' and @refgen_args < 2 ) {
+ if ( ($op->name eq 'refgen' || $op->name eq 'srefgen') and @refgen_args < 2 ) {
push @refgen_args, [ @args ];
} elsif ( $op->name eq 'aassign' ) {
push @aassign_args, [ @args ];
@@ -35,12 +35,13 @@ Runops::Trace::enable_tracing();
++$i;
my $j = $i + 42;
+my @padav;
my $y = 101;
my ( $x, @refs ) = \( $y, [qw/dancing hippies/], 33, \&foo );
$i ? foo() : bar();
-if ( foo() || 1 ) {
+if ( foo() && bar() || foo() ) {
$j = "" . $i;
}
@@ -63,7 +64,7 @@ foreach my $opname (qw(
preinc add
entersub leavesub
refgen sassign aassign
- padsv padav gv
+ padsv padav padrange gv
cond_expr and or
const
anonlist
--
2.7.4