diff options
Diffstat (limited to 'interp')
-rw-r--r-- | interp/interpreter.go | 2 | ||||
-rw-r--r-- | interp/memory.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/interp/interpreter.go b/interp/interpreter.go index d029aa333..8c783a706 100644 --- a/interp/interpreter.go +++ b/interp/interpreter.go @@ -637,7 +637,7 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent // Create the new object. size := operands[0].(literalValue).value.(uint64) alloca := object{ - llvmType: inst.llvmInst.Type(), + llvmType: inst.llvmInst.AllocatedType(), globalName: r.pkgName + "$alloca", buffer: newRawValue(uint32(size)), size: uint32(size), diff --git a/interp/memory.go b/interp/memory.go index 583f9355f..6a537bad8 100644 --- a/interp/memory.go +++ b/interp/memory.go @@ -37,7 +37,7 @@ import ( // ability to roll back interpreting a function. type object struct { llvmGlobal llvm.Value - llvmType llvm.Type // must match llvmGlobal.Type() if both are set, may be unset if llvmGlobal is set + llvmType llvm.Type // must match llvmGlobal.GlobalValueType() if both are set, may be unset if llvmGlobal is set llvmLayoutType llvm.Type // LLVM type based on runtime.alloc layout parameter, if available globalName string // name, if not yet created (not guaranteed to be the final name) buffer value // buffer with value as given by interp, nil if external @@ -594,7 +594,7 @@ func (v pointerValue) toLLVMValue(llvmType llvm.Type, mem *memoryView) (llvm.Val var globalType llvm.Type if !obj.llvmType.IsNil() { // The exact type is known. - globalType = obj.llvmType.ElementType() + globalType = obj.llvmType } else { // !obj.llvmLayoutType.IsNil() // The exact type isn't known, but the object layout is known. globalType = obj.llvmLayoutType |