mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Fixing crash in memory profiling.
This commit is contained in:
parent
9adefcfbd4
commit
9fafe286c1
1 changed files with 5 additions and 6 deletions
11
src/Val.cc
11
src/Val.cc
|
@ -3163,14 +3163,13 @@ unsigned int RecordVal::MemoryAllocation() const
|
||||||
{
|
{
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
|
|
||||||
for ( int i = 0; i < type->AsRecordType()->NumFields(); ++i )
|
const val_list* vl = AsRecord();
|
||||||
{
|
|
||||||
Val* v = (*val.val_list_val)[i];
|
|
||||||
|
|
||||||
// v might be nil for records that don't wind
|
loop_over_list(*vl, i)
|
||||||
// up being set to a value.
|
{
|
||||||
|
Val* v = (*vl)[i];
|
||||||
if ( v )
|
if ( v )
|
||||||
size += v->MemoryAllocation();
|
size += v->MemoryAllocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
return size + padded_sizeof(*this) + val.val_list_val->MemoryAllocation();
|
return size + padded_sizeof(*this) + val.val_list_val->MemoryAllocation();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue