+{
+ #50256
+ # This test is for the bit pattern "\x61\x62", which is ASCII "ab"
+ my ($v) = split //, unpack ('(B)*', native_to_uni('ab'));
+ is($v, 0); # Doesn't SEGV :-)
+}
+{
+ #73814
+ my $x = runperl( prog => 'print split( /,/, unpack(q(%2H*), q(hello world))), qq(\n)' );
+ is($x, "0\n", "split /a/, unpack('%2H*'...) didn't crash");
+
+ my $y = runperl( prog => 'print split( /,/, unpack(q(%32u*), q(#,3,Q)), qq(\n)), qq(\n)' );
+ is($y, "0\n", "split /a/, unpack('%32u*'...) didn't crash");
+}
+
+#90160
+is(eval { () = unpack "C0 U*", ""; "ok" }, "ok",
+ 'medial U* on empty string');
+
+package o {
+ use overload
+ '""' => sub { ++$o::str; "42" },
+ '0+' => sub { ++$o::num; 42 };
+}
+is pack("c", bless [], "o"), chr(42), 'overloading called';
+is $o::str, undef, 'pack "c" does not call string overloading';
+is $o::num, 1, 'pack "c" does call num overloading';
+
+#[perl #123874]: argument underflow leads to corrupt length
+eval q{ pack "pi/x" };
+ok(1, "argument underflow did not crash");
+
+{
+ # [perl #126325] pack [hH] with a unicode string
+ # the hex encoders would read past the end of the string, using
+ # invalid source bytes
+ my $twenty_nuls = "\0" x 20;
+ # This is the case that failed
+ is(pack("WH40", 0x100, ""), "\x{100}$twenty_nuls",
+ "check pack H zero fills (utf8 target)");
+ my $up_nul = "\0";
+
+ utf8::upgrade($up_nul);
+ # check the other combinations too
+ is(pack("WH40", 0x100, $up_nul), "\x{100}$twenty_nuls",
+ "check pack H zero fills (utf8 target/source)");
+ is(pack("H40", ""), $twenty_nuls,
+ "check pack H zero fills (utf8 none)");
+ is(pack("H40", $up_nul), $twenty_nuls,
+ "check pack H zero fills (utf8 source)");
+}