aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-12-15 16:23:48 -0800
committerEli Schwartz <eschwartz93@gmail.com>2023-01-18 17:55:41 -0500
commite0efc7603e3f3a84f9f940d06a8058ec0b48b62b (patch)
tree1081752e6294a2f0a8639d0b63f430081dbe0208 /mesonbuild/interpreter/interpreter.py
parent42bfe534464c724f756cc326cb47cf4f3e01f3c4 (diff)
downloadmeson-e0efc7603e3f3a84f9f940d06a8058ec0b48b62b.zip
meson-e0efc7603e3f3a84f9f940d06a8058ec0b48b62b.tar.gz
meson-e0efc7603e3f3a84f9f940d06a8058ec0b48b62b.tar.bz2
coredata: Make a deepcopy of global state before mutating
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.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
0 files changed, 0 insertions, 0 deletions