mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Avoid initializing array length variables twice in generated code
This commit is contained in:
parent
299f39e8e2
commit
65da8cf5de
1 changed files with 3 additions and 1 deletions
|
@ -252,7 +252,9 @@ void ArrayType::GenArrayLength(Output* out_cc, Env* env, const DataPtr& data)
|
|||
if ( ! incremental_parsing() )
|
||||
{
|
||||
arraylength_var_field_->GenTempDecls(out_cc, env);
|
||||
arraylength_var_field_->GenInitCode(out_cc, env);
|
||||
// This is about to get initialized below, don't initialize it twice.
|
||||
if ( ! length_ && ! attr_restofdata_ )
|
||||
arraylength_var_field_->GenInitCode(out_cc, env);
|
||||
}
|
||||
|
||||
if ( length_ )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue