GH-839: Fix use of &optional sub-records within table/set indices

This commit is contained in:
Jon Siwek 2021-05-26 13:28:13 -07:00
parent 5f57daf9d1
commit 77f1ede661
3 changed files with 56 additions and 0 deletions

View file

@ -509,6 +509,9 @@ int CompositeHash::SingleTypeKeySize(Type* bt, const Val* v,
case TYPE_RECORD:
{
if ( ! v )
return (optional && ! calc_static_size) ? sz : 0;
const RecordVal* rv = v ? v->AsRecordVal() : nullptr;
RecordType* rt = bt->AsRecordType();
int num_fields = rt->NumFields();