Fixing crash in memory profiling.

This commit is contained in:
Robin Sommer 2011-08-05 12:45:05 -07:00
parent 9adefcfbd4
commit 9fafe286c1

View file

@ -3163,12 +3163,11 @@ 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();
} }