10/03/29 22:40:24
>>272
Error 00001. 0x130610 (Thread 0x0EEC):
Access overrun: Attempt to access 4 byte(s) at 0x00B8F550+4000, that is at
offset 0+4000 in heap block 0x00B8F550 which is only 4001 bytes long.
| sieve1.c line 27:
| if(sieve==NULL) exit(1);
|
|> for(i=0;i<=limit;i++) sieve[i]=0;
| for(i=4;i<=limit;i+=2) sieve[i]=1;
| for(i=3;i<=limit/2;i+=2){
Call Tree:
0x0040123C(=sieve1.exe:0x01:00023C) sieve1.c#27
0x004011A3(=sieve1.exe:0x01:0001A3) sieve1.c#13
0x32AD8D9E(=CC32100MT.DLL:0x01:0D7D9E)
The memory block (0x00B8F550) [size: 4001 bytes] was allocated with malloc
| sieve1.c line 24:
| void make_sieve(int limit){
| int i,j,idx,cnt;
|> int *sieve=(int*)malloc(sizeof(int)*limit+1);
| if(sieve==NULL) exit(1);
|
Call Tree:
0x0040121A(=sieve1.exe:0x01:00021A) sieve1.c#24
0x004011A3(=sieve1.exe:0x01:0001A3) sieve1.c#13
0x32AD8D9E(=CC32100MT.DLL:0x01:0D7D9E)
なんか一杯エラー出る
範囲外をアクセスしてるみたいだね