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.
@@ -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'
