After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580667 - Fix nullable out parameter clearing
Fix nullable out parameter clearing
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other All
: Normal blocker
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 579611 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-28 23:30 UTC by Didier "Ptitjes"
Modified: 2009-05-14 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Didier "Ptitjes" 2009-04-28 23:30:57 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:
Comment 2 Levi Bard 2009-04-30 12:29:44 UTC
Does it really make sense to have defaultable/optional out params?
My instinct is that they should be disallowed.
Comment 3 Jürg Billeter 2009-05-14 15:43:15 UTC
This issue is not restricted to the use of default arguments.
Comment 4 Jürg Billeter 2009-05-14 16:01:17 UTC
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>
Comment 5 Jaap A. Haitsma 2009-05-14 18:27:33 UTC
*** Bug 579611 has been marked as a duplicate of this bug. ***