mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
compiler: support function pointers outside of addrspace 0
In LLVM 8, the AVR backend has moved all function pointers to address space 1 by default. Much of the code still assumes function pointers live in address space 0, leading to assertion failures. This commit fixes this problem by autodetecting function pointers and avoiding them in interface pseudo-calls.
This commit is contained in:
committed by
Ron Evans
parent
c7fdb6741f
commit
c7b91da8c4
@@ -39,8 +39,8 @@ func interfaceTypeAssert(ok bool) {
|
||||
// See compiler/interface-lowering.go for details.
|
||||
|
||||
type interfaceMethodInfo struct {
|
||||
signature *uint8 // external *i8 with a name identifying the Go function signature
|
||||
funcptr *uint8 // bitcast from the actual function pointer
|
||||
signature *uint8 // external *i8 with a name identifying the Go function signature
|
||||
funcptr uintptr // bitcast from the actual function pointer
|
||||
}
|
||||
|
||||
// Pseudo function call used while putting a concrete value in an interface,
|
||||
@@ -59,4 +59,4 @@ func interfaceImplements(typecode uintptr, interfaceMethodSet **uint8) bool
|
||||
|
||||
// Pseudo function that returns a function pointer to the method to call.
|
||||
// See the interface lowering pass for how this is lowered to a real call.
|
||||
func interfaceMethod(typecode uintptr, interfaceMethodSet **uint8, signature *uint8) *uint8
|
||||
func interfaceMethod(typecode uintptr, interfaceMethodSet **uint8, signature *uint8) uintptr
|
||||
|
||||
Reference in New Issue
Block a user