On Thu, 22 Feb 2007, Udo Giacomozzi wrote:

Thursday, February 22, 2007, 2:23:29 PM, I wrote:
UG> -    string str = ptr->fgets(str);
UG> +    string str;
UG> +    str = ptr->fgets(str);

Don't really know why this patch was necessary, but I got always
segementation faults when the function returned...

AFAIK:

The string object hasn't finished construction yet when it is used in the call to ptr->fgets(). This could be in part due to the compiler optimising

string str = ptr->fgets(str);

to

string str (ptr->fgets(str));

And therefore, a pointer to the object that isn't yet completely initialised is used and this crashes.

Bastiaan


_______________________________________________
Gnash-commit mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-commit

Reply via email to