GNOME Bugzilla – Bug 567685
TreeModel iter stamp sign extension on int==32bit long==64bit
Last modified: 2021-07-05 12:22:17 UTC
On an int==32bits long==64bits system I believe the TreeModel bindings in a couple of places sign extend the GtkTreeIter stamp value but in others zero extend it when making an IV. I noticed this in cpantesters reports about one of my models where I had foolishly made a stamp potentially >= 0x8000_0000. The following might exhibit the problem, use strict; use warnings; use Gtk2; my $stamp = 0x8000_0000; print "intended stamp $stamp\n"; my $iter = Gtk2::TreeIter->new_from_arrayref ([$stamp,0,undef,undef]); my $aref = $iter->to_arrayref ($stamp); print "aref got stamp ", $aref->[0], "\n"; If the stamp is meant to be treated as unsigned (which does seem easiest to me, though it's actually a signed gint) then a cast in sv_from_iter() might be needed [untested], av_push (av, newSVuv ((guint) iter->stamp)); and along the same lines probably in the compare done by to_arrayref, to truncate if (iter->stamp != (gint) stamp)
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME?utf8=%E2%9C%93&filter=perl- Thank you for your understanding and your help.