mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
error propagation fix for AST reduction
This commit is contained in:
parent
783b6d1fdb
commit
d8213246ea
1 changed files with 6 additions and 1 deletions
|
@ -2119,7 +2119,12 @@ ExprPtr ArithCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt)
|
|||
const auto& ct = cv->GetType();
|
||||
|
||||
if ( IsArithmetic(t->Tag()) || IsArithmetic(ct->Tag()) )
|
||||
return make_intrusive<ConstExpr>(FoldSingleVal(cv, t));
|
||||
{
|
||||
auto v = FoldSingleVal(cv, t);
|
||||
if ( v )
|
||||
return make_intrusive<ConstExpr>(v);
|
||||
// else there was a coercion error, fall through
|
||||
}
|
||||
}
|
||||
|
||||
if ( c->Optimizing() )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue