Branch: Tag:

2016-09-14

2016-09-14 09:12:01 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)].

8644:   test_eq("f\77777777\77777777bargaz\77777777nk"[..2],"f\77777777\77777777")   test_eq("f\77777777\77777777bargaz\77777777nk"[..5],"f\77777777\77777777bar")    + 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}))