diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py --- a/libcxx/utils/libcxx/test/dsl.py +++ b/libcxx/utils/libcxx/test/dsl.py @@ -6,6 +6,7 @@ # #===----------------------------------------------------------------------===## +import copy import os import pipes import platform @@ -37,7 +38,10 @@ result = next(res for (key, res) in cache if key == cacheKey) except StopIteration: # This wasn't in the cache result = function(*args, **kwargs) - cache.append((cacheKey, result)) + # Note: we have to use copy.deepcopy() here to avoid storing a + # mutable list in the cache, since that would cause cache hits + # even when the list changed compared to when the value was cached. + cache.append((copy.deepcopy(cacheKey), result)) return result return f return decorator