Skip to content

Commit

Permalink
20122: Fixes data corruption issue when setting entity code when at l…
Browse files Browse the repository at this point in the history
…east two nodes share the same label name (#122)
  • Loading branch information
howsohazard authored May 1, 2024
1 parent 99b424f commit 8b90164
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Amalgam/entity/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ void Entity::AccumRoot(EvaluableNodeReference accum_code, bool allocated_with_en
auto [new_label_index, collision_free] = EvaluableNodeTreeManipulation::RetrieveLabelIndexesFromTreeAndNormalize(
evaluableNodeManager.GetRootNode());

std::swap(labelIndex, new_labels);
std::swap(labelIndex, new_label_index);
}

if(container_caches != nullptr)
Expand Down
25 changes: 18 additions & 7 deletions src/Amalgam/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ current_index: 2
interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe"
raaa 2
rwww 1
start_time 1712874365.933566
start_time 1714575485.109338
www 1
x 12
zz 10
Expand Down Expand Up @@ -1302,7 +1302,7 @@ current_index: 2
interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe"
raaa 2
rwww 1
start_time 1712874365.933566
start_time 1714575485.109338
www 1
x 12
zz 10
Expand Down Expand Up @@ -1344,7 +1344,7 @@ current_index: 2
interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe"
raaa 2
rwww 1
start_time 1712874365.933566
start_time 1714575485.109338
www 1
x 12
zz 10
Expand Down Expand Up @@ -1612,7 +1612,7 @@ e:
- .inf

25: (assoc a 1)
current date-time in epoch: 2024-04-11-18.26.05.9866920
current date-time in epoch: 2024-05-01-10.58.05.1487100
2020-06-07 00:22:59
1391230800
1391230800
Expand Down Expand Up @@ -3430,7 +3430,7 @@ deep sets

--set_entity_root_permission--
RootTest
1712874366.252566
1714575485.261987
(true)

RootTest
Expand Down Expand Up @@ -3672,7 +3672,18 @@ hello
(assign_entity_roots new_entity _)
)
)
(set_entity_rand_seed new_entity ">��T�!v.W�w�����")
(set_entity_rand_seed new_entity "1a2�.��W�w�����")
(set_entity_rand_seed
(first
(create_entities
(append new_entity "NewModule")
(lambda
(associate "a" 1 "b" 2)
)
)
)
"�-�O[��3yC�Œ���"
)
(set_entity_rand_seed
(first
(create_entities
Expand Down Expand Up @@ -4665,4 +4676,4 @@ concurrent entity writes successful: (true)

--clean-up test files--
--total execution time--
1.846472978591919
2.024893045425415

0 comments on commit 8b90164

Please sign in to comment.