From ee8e7ada1da1327e91dba8d50b9cf21c63168a04 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 7 Feb 2023 13:36:34 -0800 Subject: [PATCH] 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. --- mesonbuild/compilers/mixins/visualstudio.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 48d0bbbe7..de179af77 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'