GNOME Bugzilla – Bug 580667
Fix nullable out parameter clearing
Last modified: 2009-05-14 18:27:33 UTC
Please describe the problem: For a "out string? param = null" parameter, the following is generated at the beginning of the method: *param = NULL; this should be: if ((&(*param_idx)) != NULL) { *param = NULL; } Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
A fix is available here: http://git.freesmartphone.org/?p=vala-lang.git;a=commitdiff;h=0fca2615db8bfb9b630458e55f690cd8443ed411
Does it really make sense to have defaultable/optional out params? My instinct is that they should be disallowed.
This issue is not restricted to the use of default arguments.
commit 75d131e7ec8de571281bdf9cea0d1a7e27f5b14e Author: Didier 'Ptitjes <ptitjes@free.fr> Date: Wed Apr 29 01:26:50 2009 +0200 Fix null pointer access on out parameter clearing Fixes bug 580667. Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
*** Bug 579611 has been marked as a duplicate of this bug. ***