256
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
564
|
5 // @author@ Nick <Nick_member@pathlink.com>
|
256
|
6 // @date@ 2005-01-28
|
|
7 // @uri@ news:ctdtgj$30r$1@digitaldaemon.com
|
|
8 // @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/2784
|
|
9
|
|
10 module dstress.run.bug_20050128_B;
|
|
11
|
|
12 struct MyStruct{
|
|
13 int i;
|
|
14
|
|
15 void display(){
|
|
16 assert(i==10);
|
|
17 }
|
|
18
|
|
19 void someFunc(){
|
|
20 // We never call this function
|
|
21 void bug(MyStruct[] array){
|
|
22 // array[0].i = i+1; // Comment out this line and the bug goes away
|
|
23 }
|
|
24
|
|
25 assert(i==10);
|
|
26 display();
|
|
27 assert(i==10);
|
|
28 }
|
|
29 }
|
|
30
|
|
31 int main(){
|
|
32 MyStruct m;
|
|
33 m.i = 10;
|
|
34 assert(m.i==10);
|
|
35 m.someFunc();
|
|
36 assert(m.i==10);
|
|
37 return 0;
|
564
|
38 }
|