From cd21eb5b6afe384d044c44a8bb98f3c163532ecb Mon Sep 17 00:00:00 2001 From: Daniel Thayer Date: Wed, 5 Sep 2012 17:17:43 -0500 Subject: [PATCH] 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). --- src/Expr.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Expr.cc b/src/Expr.cc index e58e20f671..70aab46ab5 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -1516,6 +1516,8 @@ RemoveFromExpr::RemoveFromExpr(Expr* arg_op1, Expr* arg_op2) if ( BothArithmetic(bt1, bt2) ) PromoteType(max_type(bt1, bt2), is_vector(op1) || is_vector(op2)); + else if ( BothInterval(bt1, bt2) ) + SetType(base_type(bt1)); else ExprError("requires two arithmetic operands"); }