aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-02-07 13:36:34 -0800
committerNirbheek Chauhan <nirbheek@centricular.com>2023-02-19 02:55:58 +0530
commit95ae4f72f4a54525543b7a29ecdad1210c8a317a (patch)
tree350618625c26e6cb597cb06bacd50aead825ce57
parent71e652a6004e64a8483183f8f4a987b38d520e3d (diff)
downloadmeson-95ae4f72f4a54525543b7a29ecdad1210c8a317a.zip
meson-95ae4f72f4a54525543b7a29ecdad1210c8a317a.tar.gz
meson-95ae4f72f4a54525543b7a29ecdad1210c8a317a.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'