mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
bug fixes for stand-alone compiles with empty records
This commit is contained in:
parent
2b0f1c9d6e
commit
ac257e4a86
1 changed files with 7 additions and 0 deletions
|
@ -151,6 +151,10 @@ void CPPCompile::ExpandListTypeVar(const TypePtr& t, string& tn)
|
||||||
void CPPCompile::ExpandRecordTypeVar(const TypePtr& t, string& tn)
|
void CPPCompile::ExpandRecordTypeVar(const TypePtr& t, string& tn)
|
||||||
{
|
{
|
||||||
auto r = t->AsRecordType()->Types();
|
auto r = t->AsRecordType()->Types();
|
||||||
|
|
||||||
|
if ( ! r )
|
||||||
|
return;
|
||||||
|
|
||||||
auto t_name = tn + "->AsRecordType()";
|
auto t_name = tn + "->AsRecordType()";
|
||||||
|
|
||||||
AddInit(t, string("if ( ") + t_name + "->NumFields() == 0 )");
|
AddInit(t, string("if ( ") + t_name + "->NumFields() == 0 )");
|
||||||
|
@ -476,6 +480,9 @@ void CPPCompile::RegisterRecordType(const TypePtr& t)
|
||||||
{
|
{
|
||||||
auto r = t->AsRecordType()->Types();
|
auto r = t->AsRecordType()->Types();
|
||||||
|
|
||||||
|
if ( ! r )
|
||||||
|
return;
|
||||||
|
|
||||||
for ( auto i = 0; i < r->length(); ++i )
|
for ( auto i = 0; i < r->length(); ++i )
|
||||||
{
|
{
|
||||||
const auto& r_i = (*r)[i];
|
const auto& r_i = (*r)[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue