diff options
Diffstat (limited to 'cpp/017record')
-rw-r--r-- | cpp/017record | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/017record b/cpp/017record index 89516672..42fda587 100644 --- a/cpp/017record +++ b/cpp/017record @@ -116,7 +116,10 @@ case GET_ADDRESS: { assert(instructions[pc].ingredients[1].types.size() == 1); assert(instructions[pc].ingredients[1].types[0] == 0); // must be literal size_t offset = to_int(instructions[pc].ingredients[1].name); - int src = base_address+offset; + int src = base_address; + for (size_t i = 0; i < offset; ++i) { + src += size_of(reagent(Type[base_type].elements[i][0])); + } trace("run") << "address to copy is " << src; vector<int> result; result.push_back(src); |