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 783897 - Nullable ValueType parameters are not considered as pointer for their signal marshaller signature
Nullable ValueType parameters are not considered as pointer for their signal ...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.36.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-06-17 14:41 UTC by Marvin W
Modified: 2017-06-17 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example file causing the described issue (839 bytes, text/plain)
2017-06-17 14:41 UTC, Marvin W
  Details
Possible patch and test case. (2.48 KB, patch)
2017-06-17 14:53 UTC, Marvin W
none Details | Review
codegen: Nullable ValueType requires POINTER as marshaller signature (3.55 KB, patch)
2017-06-17 18:01 UTC, Rico Tzschichholz
committed Details | Review

Description Marvin W 2017-06-17 14:41:47 UTC
Created attachment 353945 [details]
Example file causing the described issue

The signal marshaller signature considers nullable value types (Tested with int? and enum?) as their original type but creates code specific for nullables (using ie. gvalue->pointer instead gvalue->int). As two same signatures are collapsed although they would require different code, this can lead to wrongly handling value types as their nullables or vice-versa.

This is to some extend related to #758816 and present in 0.36.3 release and current master.
Comment 1 Marvin W 2017-06-17 14:53:02 UTC
Created attachment 353947 [details] [review]
Possible patch and test case.
Comment 2 Rico Tzschichholz 2017-06-17 16:05:53 UTC
Nice catch. Interesting that this wasn't caught by the test-case of https://bugzilla.gnome.org/show_bug.cgi?id=758816
Comment 3 Rico Tzschichholz 2017-06-17 18:01:16 UTC
Created attachment 353962 [details] [review]
codegen: Nullable ValueType requires POINTER as marshaller signature

This is missing in https://bugzilla.gnome.org/show_bug.cgi?id=758816
Comment 4 Rico Tzschichholz 2017-06-17 18:05:50 UTC
@marvin, Please take a look at this patch and test it.
Comment 5 Rico Tzschichholz 2017-06-17 20:11:13 UTC
Attachment 353962 [details] pushed as 4073243 - codegen: Nullable ValueType requires POINTER as marshaller signature