added type coercion for bit-shifting expressions

This commit is contained in:
Vern Paxson 2024-12-04 15:21:20 -07:00
parent a44cafafe7
commit 01fe72d9fc
2 changed files with 5 additions and 2 deletions

@ -1 +1 @@
Subproject commit 3c17f9797ebab5157d7b08265540cd7f4de15d1f
Subproject commit 0f32b4a05a7e1772d1a0a9b366ebd7a815e1af39

View file

@ -1860,8 +1860,11 @@ BitExpr::BitExpr(ExprTag arg_tag, ExprPtr arg_op1, ExprPtr arg_op2)
if ( IsIntegral(bt1) && bt2 == TYPE_COUNT ) {
if ( is_vector(op1) || is_vector(op2) )
SetType(make_intrusive<VectorType>(base_type(bt1)));
else
else {
SetType(base_type(bt1));
if ( bt1 != bt2 )
op2 = make_intrusive<ArithCoerceExpr>(op2, bt1);
}
}
else if ( IsIntegral(bt1) && bt2 == TYPE_INT )