Branch: Tag:

2014-09-30

2014-09-30 15:52:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Optimizer: Fixed over-optimization of F_ASSIGN_SELF nodes.

F_ASSIGN_SELF nodes weren't marked as OPT_ASSIGNMENT, so they
could sometimes be removed by the optimizer.

Also fixes some related optimizer and type-checker issues.

Thanks to Chris Angelico <rosuav@gmail.com> for the report.

Fixes [LysLysKOM 20983743].

8681:      // testing -=   test_any(int a=1; a-=10; return a,-9) + test_do([[ add_constant("FOO", class { +  array(string) arr = ({ "a", "b", "c" }); +  }()); ]]) + test_any_equal([[ +  // LysLysKOM 20983743. +  compile_string("void x() {string z=\"a\"; FOO->arr-=({z});}")()->x(); +  compile_string("void x() {string z=\"b\"; FOO->arr=FOO->arr-({z});}")()->x(); +  compile_string("void x() {FOO->arr-=({\"c\"});}")()->x(); +  return FOO->arr; + ]], ({})) + test_do([[ add_constant("FOO"); ]])   // testing &=   test_any(int a=3; a&=10; return a,2)   // testing |=