}
}
else {
- Copy(AvARRAY((const AV *)TARG), SP+1, maxarg, SV*);
+ PADOFFSET i;
+ for (i=0; i < (PADOFFSET)maxarg; i++) {
+ SV * const sv = AvARRAY((const AV *)TARG)[i];
+ SP[i+1] = sv ? sv : &PL_sv_undef;
+ }
}
SP += maxarg;
}
require 'test.pl';
}
-plan (136);
+plan (137);
#
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
'exists returns true for &PL_sv_undef elem [perl #7508]';
is \$_[0], \undef, 'undef preserves identity in array [perl #109726]';
}->(undef);
+# and that padav also knows how to handle the resulting NULLs
+@_ = sub { my @a; $a[1]=1; @a }->();
+is join (" ", map $_//"undef", @_), "undef 1",
+ 'returning my @a with nonexistent elements';
# [perl #118691]
@plink=@plunk=();