aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-02-07 13:36:34 -0800
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-02-08 15:31:58 +0530
commitee8e7ada1da1327e91dba8d50b9cf21c63168a04 (patch)
tree204048ed5684c2bf0385323c4a5be4888bfb5ed2
parentb2f7f2da1c5e693a426b0aa636a8b256bd1efe83 (diff)
downloadmeson-ee8e7ada1da1327e91dba8d50b9cf21c63168a04.zip
meson-ee8e7ada1da1327e91dba8d50b9cf21c63168a04.tar.gz
meson-ee8e7ada1da1327e91dba8d50b9cf21c63168a04.tar.bz2
compilers: Copy const always_args before returning
Eventually we would probably be better served (to avoid unnecessary copies) to use the ImmutableListProtocol here, but for the moment this is effective, it's also what we do in every other case.
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py
index 48d0bbb..de179af 100644
--- a/mesonbuild/compilers/mixins/visualstudio.py
+++ b/mesonbuild/compilers/mixins/visualstudio.py
@@ -140,7 +140,8 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
# Override CCompiler.get_always_args
def get_always_args(self) -> T.List[str]:
- return self.always_args
+ # TODO: use ImmutableListProtocol[str] here instead
+ return self.always_args.copy()
def get_pch_suffix(self) -> str:
return 'pch'