When a compiler is initialized, it adds specific options that it supports, but taking some global UserOption objects and adding them to itself. When it does so, it mutates then if necessary. This means that each compiler initialized mutates global state, this is bad. This is worse because in our test suite we do in process testing, so these mutations are preserved *between tests*, potentially leading to incorrect results. The simple fix is to do the right thing, and copy the UserOption before mutating. A deepcopy is required because the option might be an ArrayOption, and a shallow copy is not sufficient in that case.pull/11288/head
parent
42bfe53446
commit
e0efc7603e
1 changed files with 3 additions and 1 deletions
Loading…
Reference in new issue