When an opcode expands to a list of jobs, we extend the reason trail
of the new jobs with that of the original opcode that expanded to them.
Before before modifying the reason trail, however, we should duplicate
it to avoid side effects on shared copies---like the default empty list.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/mcpu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/mcpu.py b/lib/mcpu.py
index 72f13bf..ac26054 100644
--- a/lib/mcpu.py
+++ b/lib/mcpu.py
@@ -225,7 +225,7 @@ def _SetBaseOpParams(src, defcomment, dst):
     dst.comment = defcomment
 
   if hasattr(src, constants.OPCODE_REASON):
-    dst.reason = getattr(dst, constants.OPCODE_REASON, [])
+    dst.reason = list(getattr(dst, constants.OPCODE_REASON, []))
     dst.reason.extend(getattr(src, constants.OPCODE_REASON, []))
 
 
-- 
2.6.0.rc2.230.g3dd15c0

Reply via email to