From e853b94e93f0a525c857eff97b5ed3d7e9fecdac Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 25 Mar 2015 19:06:32 -0700 Subject: 971 --- cpp/019address | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cpp/019address') diff --git a/cpp/019address b/cpp/019address index c487dac6..6d697cb5 100644 --- a/cpp/019address +++ b/cpp/019address @@ -137,14 +137,16 @@ case GET: { size_t offset = instructions[pc].ingredients[1].value; int src = base_address; for (size_t i = 0; i < offset; ++i) { - src += size_of(reagent(Type[base_type].elements[i][0])); + reagent tmp; + tmp.types.push_back(Type[base_type].elements[i][0]); + src += size_of(tmp); } trace("run") << "address to copy is " << src; assert(Type[base_type].is_record); assert(Type[base_type].elements.size() > offset); int src_type = Type[base_type].elements[offset][0]; trace("run") << "its type is " << src_type; - reagent tmp(src_type); + reagent tmp; tmp.set_value(src); tmp.types.push_back(src_type); vector result(read_memory(tmp)); @@ -178,7 +180,9 @@ case GET_ADDRESS: { size_t offset = instructions[pc].ingredients[1].value; int src = base_address; for (size_t i = 0; i < offset; ++i) { - src += size_of(reagent(Type[base_type].elements[i][0])); + reagent tmp; + tmp.types.push_back(Type[base_type].elements[i][0]); + src += size_of(tmp); } trace("run") << "address to copy is " << src; vector result; -- cgit 1.4.1-2-gfad0