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 742621 - Invalid C code when disconnecting notify signal within an async method
Invalid C code when disconnecting notify signal within an async method
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Async
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-08 23:06 UTC by Jim Nelson
Modified: 2015-01-12 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Minimal test case (238 bytes, text/x-vala)
2015-01-08 23:07 UTC, Jim Nelson
Details

Description Jim Nelson 2015-01-08 23:06:29 UTC
This Vala code:

async void go_async() throws Error {
    xyzzy.notify["b"].disconnect(on_b);
}

results in invalid C:

test.vala: In function ‘go_async_co’:
test.vala:12:69: error: ‘_tmp2_’ undeclared (first use in this function)
     xyzzy.notify["b"].disconnect(on_b);

Looking at the generated C code:

_data_->_tmp2_ = 0U;
g_signal_parse_name ("notify::b", G_TYPE_OBJECT, &_data_->_tmp1_, &_tmp2_, TRUE);

The address is being taken of _tmp2_ when it should be _data_->_tmp2_.

I'll attach the test case as a separate file.
Comment 1 Jim Nelson 2015-01-08 23:07:02 UTC
Created attachment 294127 [details]
Minimal test case
Comment 2 Jim Nelson 2015-01-08 23:07:30 UTC
I should add, I'm seeing this with Vala in master.
Comment 3 Luca Bruno 2015-01-12 14:11:53 UTC
commit c0ae346ac099fb6e8bfa59dba03ac7412523183f
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Mon Jan 12 15:09:14 2015 +0100

    codegen: Fix detailed signal disconnect in async methods
    
    Fixes bug 742621

Backported to 0.26 as 71fa41b7cf2a302b8d627a4198b265e4f2305b8d

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.