mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
Fixed incorrect LLVM "getelementptr" conversion
This commit is contained in:
parent
bc0db1432e
commit
d04540e4dc
@ -1185,13 +1185,8 @@ static void llvm2ir_element_ptr(ir_ctx *ctx, LLVMValueRef insn)
|
|||||||
|
|
||||||
type_kind = LLVMGetTypeKind(type);
|
type_kind = LLVMGetTypeKind(type);
|
||||||
IR_ASSERT(type_kind == LLVMPointerTypeKind);
|
IR_ASSERT(type_kind == LLVMPointerTypeKind);
|
||||||
if (LLVMGetValueKind(op0) == LLVMGlobalVariableValueKind) {
|
type = LLVMGetGEPSourceElementType(insn);
|
||||||
type = LLVMGlobalGetValueType(op0);
|
type_kind = LLVMGetTypeKind(type);
|
||||||
type_kind = LLVMGetTypeKind(type);
|
|
||||||
} else {
|
|
||||||
type = LLVMGetGEPSourceElementType(insn);
|
|
||||||
type_kind = LLVMGetTypeKind(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
op = LLVMGetOperand(insn, 1);
|
op = LLVMGetOperand(insn, 1);
|
||||||
if (LLVMGetValueKind(op) == LLVMConstantIntValueKind) {
|
if (LLVMGetValueKind(op) == LLVMConstantIntValueKind) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user