Constant expression mapping mixup/leak
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=6062
Reported by @grubba
From LysLysKOM:
19255202 idag 02:24 /51 rader/ Martin Nilsson (Opera Mini - AFK!) Mottagare: Pike (-) developers forum <17761> Ärende: Mapping mixup
We've seen this nasty little issue. The following code
class C
{
mapping options = ([1:1]);
void create()
{
werror("%O\n\n", options);
}
}
void main()
{
C c = C();
c->options[3] = 3;
C cc = C();
}
will result in
nilsson@riaa:~$ pike --dumpversion
7.9.5
nilsson@riaa:~$ uname -a
Linux riaa 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux
nilsson@riaa:~$ pike test.pike
([ /* 1 element */
1: 1
])
([ /* 2 elements */ 1: 1, 3: 3 ])
thought it works fine on
nilsson@khora:~$ pike --dumpversion
7.9.5
nilsson@khora:~$ uname -a
Linux khora 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC
2011 i686 GNU/Linux
nilsson@khora:~$ pike test.pike
([ /* 1 element */
1: 1
])
([ /* 1 element */ 1: 1 ]) (19255202) /Martin Nilsson (Opera Mini - AFK!)/-----