@@ -662,13 +662,15 @@ pub fn bin_op<'ctx>(loc: Location, (mut lhs, lloc): (Value<'ctx>, Location), (mu
662
662
rhs. comp_val = Some ( IntValue ( if ru { ctx. builder . build_int_z_extend ( val, ctx. context . custom_width_int_type ( ls as u32 ) , "" ) }
663
663
else { ctx. builder . build_int_s_extend ( val, ctx. context . custom_width_int_type ( ls as u32 ) , "" ) } ) ) ;
664
664
}
665
+ rhs. data_type = Type :: Int ( ls, ru) ;
665
666
bin_op ( loc, ( lhs, lloc) , ( rhs, rloc) , op, ctx)
666
667
} ,
667
668
( Type :: Int ( ls, lu) , Type :: Int ( rs, _) ) if ls < rs => {
668
669
if let ( Some ( IntValue ( val) ) , false ) = ( lhs. value ( ctx) , ctx. is_const . get ( ) ) {
669
670
lhs. comp_val = Some ( IntValue ( if lu { ctx. builder . build_int_z_extend ( val, ctx. context . custom_width_int_type ( rs as u32 ) , "" ) }
670
671
else { ctx. builder . build_int_s_extend ( val, ctx. context . custom_width_int_type ( rs as u32 ) , "" ) } ) ) ;
671
672
}
673
+ lhs. data_type = Type :: Int ( rs, lu) ;
672
674
bin_op ( loc, ( lhs, lloc) , ( rhs, rloc) , op, ctx)
673
675
} ,
674
676
( Type :: Int ( ls, lu) , Type :: Int ( rs, ru) ) if ls == rs => match op {
0 commit comments