File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2696,6 +2696,19 @@ impl<'a> ConstantEvaluator<'a> {
26962696 return Err ( ConstantEvaluatorError :: InvalidBinaryOpArgs ) ;
26972697 }
26982698
2699+ if matches ! (
2700+ ( left_value, op) ,
2701+ (
2702+ Literal :: Bool ( _) ,
2703+ BinaryOperator :: Less
2704+ | BinaryOperator :: LessEqual
2705+ | BinaryOperator :: Greater
2706+ | BinaryOperator :: GreaterEqual
2707+ )
2708+ ) {
2709+ return Err ( ConstantEvaluatorError :: InvalidBinaryOpArgs ) ;
2710+ }
2711+
26992712 let literal = match op {
27002713 BinaryOperator :: Equal => Literal :: Bool ( left_value == right_value) ,
27012714 BinaryOperator :: NotEqual => Literal :: Bool ( left_value != right_value) ,
@@ -2849,6 +2862,8 @@ impl<'a> ConstantEvaluator<'a> {
28492862 ( Literal :: Bool ( a) , Literal :: Bool ( b) ) => Literal :: Bool ( match op {
28502863 BinaryOperator :: LogicalAnd => a && b,
28512864 BinaryOperator :: LogicalOr => a || b,
2865+ BinaryOperator :: And => a & b,
2866+ BinaryOperator :: InclusiveOr => a | b,
28522867 _ => return Err ( ConstantEvaluatorError :: InvalidBinaryOpArgs ) ,
28532868 } ) ,
28542869 _ => return Err ( ConstantEvaluatorError :: InvalidBinaryOpArgs ) ,
You can’t perform that action at this time.
0 commit comments