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
|
1384
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2784
|
256
|
9
|
|
10 module dstress.run.bug_20050128_B;
|
|
11
|
|
12 struct MyStruct{
|
|
13 int i;
|
|
14
|
|
15 void display(){
|
1559
|
16 if(10 != i){
|
|
17 assert(0);
|
|
18 }
|
256
|
19 }
|
|
20
|
|
21 void someFunc(){
|
|
22 // We never call this function
|
|
23 void bug(MyStruct[] array){
|
|
24 // array[0].i = i+1; // Comment out this line and the bug goes away
|
|
25 }
|
|
26
|
1559
|
27 if(10 != i){
|
|
28 assert(0);
|
|
29 }
|
256
|
30 display();
|
1559
|
31 if(10 != i){
|
|
32 assert(0);
|
|
33 }
|
256
|
34 }
|
|
35 }
|
|
36
|
|
37 int main(){
|
|
38 MyStruct m;
|
|
39 m.i = 10;
|
1559
|
40 if(10 != m.i){
|
|
41 assert(0);
|
|
42 }
|
256
|
43 m.someFunc();
|
1559
|
44 if(10 != m.i){
|
|
45 assert(0);
|
|
46 }
|
256
|
47 return 0;
|
564
|
48 }
|