b-000221-3
ldmud-3.2.9/src/done/b-000221-3 · 690 B
From the archive ldmud-329.tar.gz
Download the archive « Back to the archive contents
From: Zora
Short: foreach() and redeclarations
Date: Tue Feb 22 01:59:27 2000
Type: Bug
State: Done - fixed in 3.2.8-dev.176
foreach(<typ> xxx:yyy) ...
bugt falls xxx auch der name einer globalen funktion oder variablen
ist
(zumindest ist innerhalb der foreach-schleife der zugriff auf xxx
falsch.
auch kommen teilweise andere variablenzugriffe durcheinander)
ach ja, testen kannst du es z.B.: int x; test() { foreach(int
x:({1,2,3}))
write(x+"\n"); }
dann gibt test() 3 0-en aus
Analysis:
When the shadowing if the global identifier is detected, the compiler
used the ident* of the global to retrieve the number of the local -
which of course resulted in random memory accesses.