diff options
author | Ayke van Laethem <[email protected]> | 2020-04-12 14:09:12 +0200 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2020-05-03 15:43:45 +0200 |
commit | ca7b95039d688bc72fd39b82f54d776c6813c900 (patch) | |
tree | 5d771dce03103992877b590533a86850baf7e085 /interp/frame.go | |
parent | 7939c060ce88df506f7ff3778b9a7a341d644a8d (diff) | |
download | tinygo-builder-parallel.tar.gz tinygo-builder-parallel.zip |
interp: do not rely on fixed type namesbuilder-parallel
After merging multiple LLVM modules into one, types may have been
renamed. Therefore, the interp package should not rely on types to have
any particular name.
Diffstat (limited to 'interp/frame.go')
-rw-r--r-- | interp/frame.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/interp/frame.go b/interp/frame.go index ed7c3f98c..b487334e3 100644 --- a/interp/frame.go +++ b/interp/frame.go @@ -283,6 +283,7 @@ func (fr *frame) evalBasicBlock(bb, incoming llvm.BasicBlock, indent string) (re PkgName: fr.packagePath, KeySize: int(keySize), ValueSize: int(valueSize), + MapType: inst.Type().ElementType(), } case callee.Name() == "runtime.hashmapStringSet": // set a string key in the map @@ -350,7 +351,7 @@ func (fr *frame) evalBasicBlock(bb, incoming llvm.BasicBlock, indent string) (re global.SetLinkage(llvm.InternalLinkage) global.SetGlobalConstant(true) global.SetUnnamedAddr(true) - stringType := fr.Mod.GetTypeByName("runtime._string") + stringType := inst.Type() retPtr := llvm.ConstGEP(global, getLLVMIndices(fr.Mod.Context().Int32Type(), []uint32{0, 0})) retLen := llvm.ConstInt(stringType.StructElementTypes()[1], uint64(len(result)), false) ret := llvm.ConstNull(stringType) |