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:
Daniel Thayer 2012-09-05 17:17:43 -05:00
parent 9357aeb6b1
commit cd21eb5b6a

View file

@ -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");
} }