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 631787 - Incorrect behaviour of "+=" operator with int-value HashMaps
Incorrect behaviour of "+=" operator with int-value HashMaps
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: general
unspecified
Other All
: Urgent blocker
: 1.0
Assigned To: Vala maintainers
Vala maintainers
wrong-code
Depends on:
Blocks:
 
 
Reported: 2010-10-09 22:34 UTC by David Paleino
Modified: 2018-05-22 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
+= operator fails with int-value HashMap (192 bytes, text/plain)
2010-10-09 22:34 UTC, David Paleino
  Details
Fix assignment operators for element access (2.36 KB, patch)
2012-07-17 16:58 UTC, Simon Werbeck
none Details | Review

Description David Paleino 2010-10-09 22:34:24 UTC
Hello,
attaching a simple testcase showing the problem (thanks, Frederik!).

map["key"] = map["key"] + 1 works, while map["key"] += 1 not (nor ++, see #631781).

Kindly,
David
Comment 1 David Paleino 2010-10-09 22:34:47 UTC
Created attachment 172030 [details]
+= operator fails with int-value HashMap
Comment 2 Jürg Billeter 2010-12-23 11:07:11 UTC
Confirming, wrong C code is generated.
Comment 3 David Paleino 2011-01-10 09:03:15 UTC
*** Bug 631781 has been marked as a duplicate of this bug. ***
Comment 4 Simon Werbeck 2012-07-17 16:58:54 UTC
Created attachment 219039 [details] [review]
Fix assignment operators for element access
Comment 5 Kyrylo V. Polezhaiev 2014-05-01 10:00:21 UTC
Bug is still present in 0.24
Comment 6 Daniel Espinosa 2017-02-18 16:39:30 UTC
(In reply to David Paleino from comment #1)
> Created attachment 172030 [details]
> += operator fails with int-value HashMap

Segfault is not present as for 0.34, because map["foo"]++; is invalid syntax, as for Vala Code Generator.

Tagged for 1.0 Release.
Comment 7 GNOME Infrastructure Team 2018-05-22 13:45:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/135.