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 791556 - Accidental type aliasing when passing int arrays to generic methods results in concatenated ints
Accidental type aliasing when passing int arrays to generic methods results i...
Status: RESOLVED DUPLICATE of bug 792534
Product: vala
Classification: Core
Component: Generics
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-13 07:34 UTC by bob
Modified: 2018-01-15 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (369 bytes, text/x-vala)
2017-12-13 07:35 UTC, bob
Details

Description bob 2017-12-13 07:34:18 UTC
(Sorry if the title is a little vague, wasn't quite sure how to tersely explain)

If a method accepts a generic-typed array and you pass an int array in on a 64-bit system, the generated Vala code assumes there's one value per gpointer-sized element when in reality there's two. There's a test case coming in a moment for more info.

I'm not sure how (or if) this can really be fixed, but it seems like a moderately severe bug.
Comment 1 bob 2017-12-13 07:35:49 UTC
Created attachment 365475 [details]
Test case

Expected output:

  ** Message: test.vala:4: 0xF
  ** Message: test.vala:4: 0x1F

Actual output:

  ** Message: test.vala:4: 0x1F0000000F
  ** Message: test.vala:4: 0x7F0000003F
Comment 2 Al Thomas 2018-01-15 18:33:48 UTC

*** This bug has been marked as a duplicate of bug 792534 ***