aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/interface.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2019-01-01 20:22:39 +0100
committerRon Evans <[email protected]>2019-03-05 19:54:55 +0100
commitc7b91da8c41f5b6c268a3c434c414925ee7d02ff (patch)
treedcb288eb68cf7b59b5c91ab1e251c99dce9fa29e /src/runtime/interface.go
parentc7fdb6741fba93403ea7dedc3460172c190af121 (diff)
downloadtinygo-c7b91da8c41f5b6c268a3c434c414925ee7d02ff.tar.gz
tinygo-c7b91da8c41f5b6c268a3c434c414925ee7d02ff.zip
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.
Diffstat (limited to 'src/runtime/interface.go')
-rw-r--r--src/runtime/interface.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/interface.go b/src/runtime/interface.go
index 3daf56d23..61d3114da 100644
--- a/src/runtime/interface.go
+++ b/src/runtime/interface.go
@@ -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