This commit is contained in:
Michael Davidsaver
2019-12-20 20:04:48 -08:00
parent de47ee4acd
commit a34fe899da
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -60,7 +60,7 @@ Value::Value(const std::shared_ptr<const impl::FieldDesc>& desc)
auto& mem = top->members.at(cfld->offset-desc->offset);
mem.top = top.get();
mem.init(cfld);
top->member_indicies[cfld->offset] = pair.second;
top->member_indicies[cfld->offset-desc->offset] = pair.second;
}
this->desc = desc.get();
@@ -274,6 +274,9 @@ bool copyInScalar(Dest& dest, const void *ptr, StoreType type)
void Value::copyIn(const void *ptr, StoreType type)
{
// control flow should either throw NoField or NoConvert, or update 'store' and
// reach the mark() at the end.
if(!desc)
throw NoField();
+1 -1
View File
@@ -696,7 +696,7 @@ void from_wire_valid(Buffer& buf, TypeStore& ctxt, Value& val)
return;
for(auto bit = top->valid.findSet(desc->offset-top->desc->offset);
bit<desc->next_offset-top->desc->offset;
bit<(desc->next_offset-top->desc->offset);
bit = top->valid.findSet(bit+1))
{
std::shared_ptr<FieldStorage> cstore(store, store.get()+bit-desc->offset);