File: circular.tml

package info (click to toggle)
libyaml-tiny-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 556 kB
  • ctags: 80
  • sloc: perl: 1,363; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
=== Circular Reference Protection
# When we try to serialize, it should NOT infinite loop
--- perl
$VAR1 = [
          {
            'a' => 'b',
            'c' => [
                     {},
                     2
                   ]
          },
          []
        ];
$VAR1->[0]{'c'}[0] = $VAR1->[0];
$VAR1->[1] = $VAR1->[0]{'c'};
[ $VAR1 ]

--- error: E_CIRCULAR