mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fix the "-=" operator for intervals
Fixed a bug where "a -= b" (both operands are intervals) was not allowed in bro scripts (although "a = a - b" is allowed).
This commit is contained in:
parent
9357aeb6b1
commit
cd21eb5b6a
1 changed files with 2 additions and 0 deletions
|
@ -1516,6 +1516,8 @@ RemoveFromExpr::RemoveFromExpr(Expr* arg_op1, Expr* arg_op2)
|
||||||
|
|
||||||
if ( BothArithmetic(bt1, bt2) )
|
if ( BothArithmetic(bt1, bt2) )
|
||||||
PromoteType(max_type(bt1, bt2), is_vector(op1) || is_vector(op2));
|
PromoteType(max_type(bt1, bt2), is_vector(op1) || is_vector(op2));
|
||||||
|
else if ( BothInterval(bt1, bt2) )
|
||||||
|
SetType(base_type(bt1));
|
||||||
else
|
else
|
||||||
ExprError("requires two arithmetic operands");
|
ExprError("requires two arithmetic operands");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue