@@ -120,7 +120,7 @@ fn const_slice_backer_type<'tcx>(
120120 Type :: ClassRef ( arr_tpe)
121121}
122122pub fn load_const_value < ' tcx > (
123- const_val : ConstValue < ' tcx > ,
123+ const_val : ConstValue ,
124124 const_ty : Ty < ' tcx > ,
125125 ctx : & mut MethodCompileCtx < ' tcx , ' _ > ,
126126) -> V1Node {
@@ -135,11 +135,13 @@ pub fn load_const_value<'tcx>(
135135 let tpe = ctx. type_from_cache ( tpe) ;
136136 V1Node :: uninit_val ( tpe, ctx)
137137 }
138- ConstValue :: Slice { data, meta } => {
138+ ConstValue :: Slice { meta, alloc_id } => {
139+ // SUS
140+ let data = ctx. tcx ( ) . global_alloc ( alloc_id) . unwrap_memory ( ) ;
139141 let slice_type = ctx. type_from_cache ( const_ty) ;
140142 let slice_dotnet = slice_type. as_class_ref ( ) . expect ( "Slice type invalid!" ) ;
141143
142- let alloc_id = ctx . tcx ( ) . reserve_and_set_memory_alloc ( data ) ;
144+ let alloc_id = alloc_id ;
143145
144146 let ptr = if meta == 0 {
145147 ctx. alloc_node ( Const :: USize ( 1 << 30 ) )
@@ -173,7 +175,7 @@ fn load_scalar_ptr(
173175 ptr : rustc_middle:: mir:: interpret:: Pointer ,
174176 tpe : Interned < Type > ,
175177) -> Interned < CILNode > {
176- let ( alloc_id, offset) = ptr. into_parts ( ) ;
178+ let ( alloc_id, offset) = ptr. into_raw_parts ( ) ;
177179 let global_alloc = ctx. tcx ( ) . global_alloc ( alloc_id. alloc_id ( ) ) ;
178180 let u8_ptr = ctx. nptr ( Type :: Int ( Int :: U8 ) ) ;
179181 let u8_ptr_ptr = ctx. nptr ( u8_ptr) ;
@@ -255,6 +257,7 @@ fn load_scalar_ptr(
255257 ) ;
256258 CILNode :: LdFtn ( ctx. alloc_methodref ( mref) ) . into_idx ( ctx)
257259 }
260+ GlobalAlloc :: TypeId { ..} => todo ! ( ) ,
258261 GlobalAlloc :: VTable ( _, _) => {
259262 let ( ty, polyref) = global_alloc. unwrap_vtable ( ) ;
260263 get_vtable (
0 commit comments