GNOME Bugzilla – Bug 607902
Calling a SourceFunc that was assigned a global function segfaults
Last modified: 2010-03-22 21:30:01 UTC
This simple program: bool source_func() { return true; } void main() { SourceFunc f; f = source_func; f(); } Ends with a segfault when tried to execute it. This is because vala is currently generating: void _main (void) { GDestroyNotify f_target_destroy_notify; void* f_target = NULL; GSourceFunc f = NULL; GSourceFunc _tmp0_; ... ... } The problem is the line: GDestroyNotify f_target_destroy_notify; That is not being initialized to NULL and then should be: GDestroyNotify f_target_destroy_notify = NULL;
Created attachment 152122 [details] [review] Initialize DelegateType local variables Fixes bug 607902.
I verified with current git, and it works fine. Could you commit it please?
commit ecceaa16db8f975c5a3b8cc6c66e2d3aa84d7d42 Author: Marc-André Lureau <marcandre.lureau@gmail.com> Date: Sun Jan 24 01:43:05 2010 +0100 Initialize DelegateType local variables Fixes bug 607902.
*** Bug 597331 has been marked as a duplicate of this bug. ***