@@ -157,15 +157,13 @@ impl<'tcx> GotocCtx<'tcx> {
157
157
debug ! { "codegen_scalar\n {:?}\n {:?}\n {:?}\n {:?}" , s, ty, span, & ty. kind( ) } ;
158
158
match ( s, & ty. kind ( ) ) {
159
159
( Scalar :: Int ( _) , ty:: Int ( it) ) => match it {
160
- // We treat the data as bit vector. Thus, we extract the value as unsigned and set
161
- // the type to signed int.
162
- IntTy :: I8 => Expr :: int_constant ( s. to_u8 ( ) . unwrap ( ) , Type :: signed_int ( 8 ) ) ,
163
- IntTy :: I16 => Expr :: int_constant ( s. to_u16 ( ) . unwrap ( ) , Type :: signed_int ( 16 ) ) ,
164
- IntTy :: I32 => Expr :: int_constant ( s. to_u32 ( ) . unwrap ( ) , Type :: signed_int ( 32 ) ) ,
165
- IntTy :: I64 => Expr :: int_constant ( s. to_u64 ( ) . unwrap ( ) , Type :: signed_int ( 64 ) ) ,
166
- IntTy :: I128 => Expr :: int_constant ( s. to_u128 ( ) . unwrap ( ) , Type :: signed_int ( 128 ) ) ,
160
+ IntTy :: I8 => Expr :: int_constant ( s. to_i8 ( ) . unwrap ( ) , Type :: signed_int ( 8 ) ) ,
161
+ IntTy :: I16 => Expr :: int_constant ( s. to_i16 ( ) . unwrap ( ) , Type :: signed_int ( 16 ) ) ,
162
+ IntTy :: I32 => Expr :: int_constant ( s. to_i32 ( ) . unwrap ( ) , Type :: signed_int ( 32 ) ) ,
163
+ IntTy :: I64 => Expr :: int_constant ( s. to_i64 ( ) . unwrap ( ) , Type :: signed_int ( 64 ) ) ,
164
+ IntTy :: I128 => Expr :: int_constant ( s. to_i128 ( ) . unwrap ( ) , Type :: signed_int ( 128 ) ) ,
167
165
IntTy :: Isize => {
168
- Expr :: int_constant ( s. to_machine_usize ( self ) . unwrap ( ) , Type :: ssize_t ( ) )
166
+ Expr :: int_constant ( s. to_machine_isize ( self ) . unwrap ( ) , Type :: ssize_t ( ) )
169
167
}
170
168
} ,
171
169
( Scalar :: Int ( _) , ty:: Uint ( it) ) => match it {
0 commit comments