Branch: Tag:

2016-09-14

2016-09-14 09:10:19 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fixed broken range optimization.

The range operator was lost in the expression

A = (A + B)[low..high];

due to a fallthrough.

Fixes [bug 7780 (#7780)].

8709:      test_eq("ABCD\u2019"[1..][1..], "ABCD\u2019"[2..])    + test_any_equal([[ +  // Bug 7780 +  string s1 = "aaaaa"; +  string s2 = "BBBBBBBB"; +  s2 = (s2 + s1)[..sizeof(s1) - 1]; +  return (array)s2; + ]], ({ 66, 66, 66, 66, 66 })) +    test_equal(({1,2,3})[0..0],({1}))   test_equal(({1,2,3})[1..2],({2,3}))   test_equal(({1,2,3})[2..10],({3}))