Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test for backtracking bug in encoder

  • Loading branch information...
commit 0569e4ad299322f06d8ff56f58fa16577ff4200f 1 parent 48d5cdc
@tsee tsee authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 Perl/Encoder/t/400_evil.t
View
12 Perl/Encoder/t/400_evil.t
@@ -137,6 +137,18 @@ SCOPE: {
ok($die_run == 2, "__DIE__ called, encode 2 did not die");
}
+# github Sereal/Sereal issue 7 regression test:
+SCOPE: {
+ my $data = [sub {}];
+ $data->[1] = $data->[0];
+
+ my $encode = encode_sereal($data, {stringify_unknown => 1});
+ # Before 48d5cdc3dc07fd29ac7be05678a0b614244fec4f, we'd
+ # die here because $data->[1] is a ref to something that doesn't exist anymore
+ my $decode = decode_sereal($encode);
+ is($decode->[0], $decode->[1]);
+}
+
pass("Alive at end");
done_testing();
Please sign in to comment.
Something went wrong with that request. Please try again.