File tree 1 file changed +3
-3
lines changed
src/librustc_codegen_llvm
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -332,17 +332,17 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
332
332
alloc : & Allocation ,
333
333
offset : Size ,
334
334
) -> PlaceRef < ' tcx , & ' ll Value > {
335
- let align = alloc. align ; // follow what CTFE did, not what the layout says
335
+ assert_eq ! ( alloc. align, layout. align . abi ) ;
336
336
let init = const_alloc_to_llvm ( self , alloc) ;
337
- let base_addr = self . static_addr_of ( init, align, None ) ;
337
+ let base_addr = self . static_addr_of ( init, alloc . align , None ) ;
338
338
339
339
let llval = unsafe { llvm:: LLVMConstInBoundsGEP (
340
340
self . const_bitcast ( base_addr, self . type_i8p ( ) ) ,
341
341
& self . const_usize ( offset. bytes ( ) ) ,
342
342
1 ,
343
343
) } ;
344
344
let llval = self . const_bitcast ( llval, self . type_ptr_to ( layout. llvm_type ( self ) ) ) ;
345
- PlaceRef :: new_sized ( llval, layout, align)
345
+ PlaceRef :: new_sized ( llval, layout, alloc . align )
346
346
}
347
347
348
348
fn const_ptrcast ( & self , val : & ' ll Value , ty : & ' ll Type ) -> & ' ll Value {
You can’t perform that action at this time.
0 commit comments