This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make &xsub and goto &xsub work with tied @_
[perl5.git] / t / op / tie.t
index eb53030..06a39c4 100644 (file)
@@ -1404,3 +1404,21 @@ print "ok\n" if (eval{ $h{foo} = 1 }||$@) eq (eval{ $h{bar} = 1 }||$@);
 EXPECT
 main
 ok
+########
+
+# &xsub and goto &xsub with tied @_
+use Tie::Array;
+tie @_, Tie::StdArray;
+@_ = "\xff";
+&utf8::encode;
+printf "%x\n", $_ for map ord, split //, $_[0];
+print "--\n";
+@_ = "\xff";
+& {sub { goto &utf8::encode }};
+printf "%x\n", $_ for map ord, split //, $_[0];
+EXPECT
+c3
+bf
+--
+c3
+bf