Rollup merge of #128820 - LYF1999:yf/dev, r=nikic
fix: get llvm type of global val using `LLVMTypeOf` on a global var always return ptr. so create a new function to access the value type of a global
This commit is contained in:
@@ -390,7 +390,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||
let val_llty = self.val_ty(v);
|
||||
|
||||
let g = self.get_static_inner(def_id, val_llty);
|
||||
let llty = self.val_ty(g);
|
||||
let llty = llvm::LLVMGlobalGetValueType(g);
|
||||
|
||||
let g = if val_llty == llty {
|
||||
g
|
||||
|
||||
Reference in New Issue
Block a user