compiler: fix "fragment covers entire variable" bug

This bug could sometimes be triggered by syscall/js code it seems. But
it's a generic bug, not specific to WebAssembly.
This commit is contained in:
Ayke van Laethem
2021-03-28 15:08:01 +02:00
committed by Ron Evans
parent 4be9802d26
commit b44d41d9ec
6 changed files with 45 additions and 16 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ import (
// Version of the compiler pacakge. Must be incremented each time the compiler
// package changes in a way that affects the generated LLVM module.
// This version is independent of the TinyGo version number.
const Version = 5 // last change: add method set to interface types
const Version = 6 // last change: fix issue 1304
func init() {
llvm.InitializeAllTargets()
@@ -829,7 +829,7 @@ func (b *builder) createFunction() {
for _, param := range b.fn.Params {
llvmType := b.getLLVMType(param.Type())
fields := make([]llvm.Value, 0, 1)
for _, info := range expandFormalParamType(llvmType, param.Name(), param.Type()) {
for _, info := range b.expandFormalParamType(llvmType, param.Name(), param.Type()) {
param := b.llvmFn.Param(llvmParamIndex)
param.SetName(info.name)
fields = append(fields, param)