From 2789e86118e1f4da63e5b8883ffdb4ef31c98887 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 8 Nov 2016 09:57:31 -0800 Subject: 3651 I was under the impression that I only needed static array lengths for container members, but these are *payload* types for allocations. So we need to compute the size of a dynamic array. --- 036refcount.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '036refcount.cc') diff --git a/036refcount.cc b/036refcount.cc index 55291fa4..765efba7 100644 --- a/036refcount.cc +++ b/036refcount.cc @@ -711,8 +711,13 @@ if (is_mu_container(canonized_x) || is_mu_exclusive_container(canonized_x)) { const container_metadata& metadata = get(Container_metadata, canonized_x.type); for (map, set >::const_iterator p = metadata.address.begin(); p != metadata.address.end(); ++p) { if (!all_match(data, p->first)) continue; - for (set::const_iterator info = p->second.begin(); info != p->second.end(); ++info) - decrement_refcount(get_or_insert(Memory, canonized_x.value + info->offset), info->payload_type, size_of(info->payload_type)+/*refcount*/1); + for (set::const_iterator info = p->second.begin(); info != p->second.end(); ++info) { + int element_address = get_or_insert(Memory, canonized_x.value + info->offset); + reagent/*local*/ element; + element.set_value(element_address+/*skip refcount*/1); + element.type = new type_tree(*info->payload_type); + decrement_refcount(element_address, info->payload_type, size_of(element)+/*refcount*/1); + } } } -- cgit 1.4.1-2-gfad0