File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,10 @@ mod imp {
157157 // going to be cross-lang LTOed anyway. However, using expose is shorter and
158158 // requires less unsafe.
159159 let addr: usize = ptr. expose_provenance ( ) ;
160+ #[ cfg( bootstrap) ]
160161 let image_base = unsafe { addr_of ! ( __ImageBase) } . addr ( ) ;
162+ #[ cfg( not( bootstrap) ) ]
163+ let image_base = addr_of ! ( __ImageBase) . addr ( ) ;
161164 let offset: usize = addr - image_base;
162165 Self ( offset as u32 )
163166 }
@@ -250,7 +253,10 @@ extern "C" {
250253// This is fine since the MSVC runtime uses string comparison on the type name
251254// to match TypeDescriptors rather than pointer equality.
252255static mut TYPE_DESCRIPTOR : _TypeDescriptor = _TypeDescriptor {
256+ #[ cfg( bootstrap) ]
253257 pVFTable : unsafe { addr_of ! ( TYPE_INFO_VTABLE ) } as * const _ ,
258+ #[ cfg( not( bootstrap) ) ]
259+ pVFTable : addr_of ! ( TYPE_INFO_VTABLE ) as * const _ ,
254260 spare : core:: ptr:: null_mut ( ) ,
255261 name : TYPE_NAME ,
256262} ;
You can’t perform that action at this time.
0 commit comments