GNOME Bugzilla – Bug 698997
Slicing conversion issue on non-x86 architectures
Last modified: 2013-05-21 04:40:38 UTC
Created attachment 242620 [details] Generated C code Executing the included code on e.g. armhf, the assertion fails. If I explicitly cast the uint64 to int in the generated code, it works there. nemequ suggested as a work-around on IRC to use an unowned temporary variable, which works as well. class Foo : Object { public signal void available(uint8[] data); public void run() { Timeout.add_seconds (1, () => { uint64 length = 65536; var data = new uint8[65537]; this.available(data[0:length]); return false; }); } } class Bar : Object { public Bar(Foo foo) { foo.available.connect((data) => { assert (data.length == 65536); }); } } int main (string[] args) { var foo = new Foo(); var bar = new Bar(foo); foo.run(); var loop = new MainLoop(null, false); loop.run(); return 0; }
Created attachment 242662 [details] [review] Tentative patch Can you please verify that the attached patch fixes the issue?
Yes, that seems to fix it here
commit d1145ab86d6eb11fab5d9d813300b57812b2ba18 Author: Jürg Billeter <j@bitron.ch> Date: Sat Apr 27 17:31:02 2013 +0200 Set target_type for start and stop values of slice expressions This ensures type conversions are generated as needed. Fixes bug 698997.