Mail Archives: djgpp/2000/12/19/10:48:01
from: Johan Henriksson, leadprogrammer @ www.realsoftware.cjb.net
"The individual should be praised for it's struggle, the society
condemned for it's actions" - me 1997 #12035895
----------------------------------------------------------------------------
-------------------
>Here is a bug that I think should be verified by you guys before I report
it
>(as it could be my fault). This is an exact source code listing:
>struct Intptrholder
>{
> int * intinstruct;
>};
>
>int main()
>{
> int * intptr;
> Intptrholder * intptrholder;
> intptrholder->intinstruct = intptr;
> return 0;
>}
Isn't it quite obvius? You're dereferencing the pointer intptrholder with is
invalid
and then writes the adress of intptr to intinstruct, causing the GPF. Valid
version:
struct Intptrholder
{
int * intinstruct;
};
int main()
{
int * intptr;
Intptrholder intptrholder;
intptrholder.intinstruct = intptr;
return(0);
}
- Raw text -