mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
compiler,runtime: fix multiple definitions of a single function
strings.IndexByte was implemented in the runtime up to Go 1.11. It is implemented using a direct call to internal/bytealg.IndexByte since Go 1.12. Make sure we remain compatible with both.
This commit is contained in:
committed by
Ron Evans
parent
7e6a54ac62
commit
f2cd4d12e8
@@ -820,6 +820,9 @@ func (c *Compiler) parseFunc(frame *Frame) {
|
||||
if c.DumpSSA {
|
||||
fmt.Printf("\nfunc %s:\n", frame.fn.Function)
|
||||
}
|
||||
if !frame.fn.LLVMFn.IsDeclaration() {
|
||||
panic("function is already defined: " + frame.fn.LLVMFn.Name())
|
||||
}
|
||||
if !frame.fn.IsExported() {
|
||||
frame.fn.LLVMFn.SetLinkage(llvm.InternalLinkage)
|
||||
frame.fn.LLVMFn.SetUnnamedAddr(true)
|
||||
|
||||
Reference in New Issue
Block a user