mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
added type coercion for bit-shifting expressions
This commit is contained in:
parent
a44cafafe7
commit
01fe72d9fc
2 changed files with 5 additions and 2 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 3c17f9797ebab5157d7b08265540cd7f4de15d1f
|
Subproject commit 0f32b4a05a7e1772d1a0a9b366ebd7a815e1af39
|
|
@ -1860,8 +1860,11 @@ BitExpr::BitExpr(ExprTag arg_tag, ExprPtr arg_op1, ExprPtr arg_op2)
|
||||||
if ( IsIntegral(bt1) && bt2 == TYPE_COUNT ) {
|
if ( IsIntegral(bt1) && bt2 == TYPE_COUNT ) {
|
||||||
if ( is_vector(op1) || is_vector(op2) )
|
if ( is_vector(op1) || is_vector(op2) )
|
||||||
SetType(make_intrusive<VectorType>(base_type(bt1)));
|
SetType(make_intrusive<VectorType>(base_type(bt1)));
|
||||||
else
|
else {
|
||||||
SetType(base_type(bt1));
|
SetType(base_type(bt1));
|
||||||
|
if ( bt1 != bt2 )
|
||||||
|
op2 = make_intrusive<ArithCoerceExpr>(op2, bt1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( IsIntegral(bt1) && bt2 == TYPE_INT )
|
else if ( IsIntegral(bt1) && bt2 == TYPE_INT )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue