mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Guard against nullptr deref after AST-reduction consistency checks
Addresses Coverity issue 1443771
This commit is contained in:
parent
5bc9c818ad
commit
12f9ba5f37
1 changed files with 9 additions and 2 deletions
|
@ -56,9 +56,16 @@ void optimize_func(ScriptFunc* f, ProfileFunc* pf, ScopePtr scope_ptr,
|
||||||
|
|
||||||
non_reduced_perp = nullptr;
|
non_reduced_perp = nullptr;
|
||||||
checking_reduction = true;
|
checking_reduction = true;
|
||||||
|
|
||||||
if ( ! new_body->IsReduced(rc) )
|
if ( ! new_body->IsReduced(rc) )
|
||||||
printf("Reduction inconsistency for %s: %s\n", f->Name(),
|
{
|
||||||
obj_desc(non_reduced_perp).c_str());
|
if ( non_reduced_perp )
|
||||||
|
printf("Reduction inconsistency for %s: %s\n", f->Name(),
|
||||||
|
obj_desc(non_reduced_perp).c_str());
|
||||||
|
else
|
||||||
|
printf("Reduction inconsistency for %s\n", f->Name());
|
||||||
|
}
|
||||||
|
|
||||||
checking_reduction = false;
|
checking_reduction = false;
|
||||||
|
|
||||||
if ( analysis_options.only_func || analysis_options.dump_xform )
|
if ( analysis_options.only_func || analysis_options.dump_xform )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue