summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-15 17:53:35 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-15 17:53:35 +0200
commit9e6cfceaaca4c279432c7bc17d49d3ed354d6b8f (patch)
treea1d17cc4cd19fe2d970b08f42b0ed71c833d4ef2 /tonkadur.py
parentb111e498e98316293d3ad0c6e9e37049dcaf6285 (diff)
set_value should copy values...
Diffstat (limited to 'tonkadur.py')
-rw-r--r--tonkadur.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tonkadur.py b/tonkadur.py
index 8549847..8c0dee1 100644
--- a/tonkadur.py
+++ b/tonkadur.py
@@ -198,7 +198,6 @@ class Tonkadur:
target = target[addr]
# if (isinstance(target, list)):
# print("That's a list.")
-
return target
def resolve_choice_to (self, line):
@@ -295,7 +294,13 @@ class Tonkadur:
if (access in current_val):
current_val = current_val[access]
- pre_val[last_access] = self.compute(instruction["value"])
+
+ result = self.compute(instruction["value"])
+
+ if (isinstance(result, list) or isinstance(result, dict)):
+ result = copy.deepcopy(result)
+
+ pre_val[last_access] = result
self.program_counter += 1