tracking of original size of records (pre redef'ing)

This commit is contained in:
Vern Paxson 2021-04-01 17:38:31 -07:00
parent 6e8baafeb9
commit 45004872e8
2 changed files with 8 additions and 0 deletions

View file

@ -850,6 +850,8 @@ RecordType::RecordType(type_decl_list* arg_types) : Type(TYPE_RECORD)
} }
else else
num_fields = 0; num_fields = 0;
num_orig_fields = num_fields;
} }
// in this case the clone is actually not so shallow, since // in this case the clone is actually not so shallow, since

View file

@ -611,6 +611,7 @@ public:
{ return managed_fields; } { return managed_fields; }
int NumFields() const { return num_fields; } int NumFields() const { return num_fields; }
int NumOrigFields() const { return num_orig_fields; }
/** /**
* Returns a "record_field_table" value for introspection purposes. * Returns a "record_field_table" value for introspection purposes.
@ -654,7 +655,12 @@ protected:
// use std::bitset here instead. // use std::bitset here instead.
std::vector<bool> managed_fields; std::vector<bool> managed_fields;
// Number of fields in the type.
int num_fields; int num_fields;
// Number of fields in the type when originally declared.
int num_orig_fields;
type_decl_list* types; type_decl_list* types;
}; };