GNOME Bugzilla – Bug 667452
Vala array.move assume overlapping regions
Last modified: 2012-07-12 12:02:42 UTC
Created attachment 204795 [details] [review] 0001-Allow-move-array-elements-even-in-case-when-the-area.patch The code for array.move assumes overlapping regions. Compare output for following program: int main() { int[] items = new int[10]; for(int i = 0; i < 10; i++) items[i] = i + 1; items.move(0, 3, 2); items.move(5, 6, 3); for(int i = 0; i < 10; i++) stdout.printf("%d: %d\n", i + 1, items[i]); return 0; } patched: 1: 0 2: 0 3: 3 4: 1 5: 2 6: 0 7: 6 8: 7 9: 8 10: 10 unpatched: 1: 0 2: 0 3: 0 4: 1 5: 2 6: 0 7: 6 8: 7 9: 8 10: 10
commit b3ade40b8afd69c171ea435ebfb92ae9b6a643e5 Author: Maciej Piechotka <uzytkownik2@gmail.com> Date: Sat Jan 7 04:19:25 2012 +0100 codegen: Fix array move when the areas don't overlap Fixes bug 667452.