mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler: fix crash with linked lists in interfaces
This commit fixes the following issue: https://github.com/tinygo-org/tinygo/issues/309 Also, it prepares for some other reflect-related changes that should make it easier to add support for named types (etc.) in the future.
This commit is contained in:
committed by
Ron Evans
parent
a04db67ea9
commit
33dc4b5121
+3
-3
@@ -16,13 +16,13 @@ type funcValue struct {
|
||||
|
||||
// funcValueWithSignature is used before the func lowering pass.
|
||||
type funcValueWithSignature struct {
|
||||
funcPtr uintptr // ptrtoint of the actual function pointer
|
||||
signature *uint8 // pointer to identify this signature (the value is undef)
|
||||
funcPtr uintptr // ptrtoint of the actual function pointer
|
||||
signature *typecodeID // pointer to identify this signature (the value is undef)
|
||||
}
|
||||
|
||||
// getFuncPtr is a dummy function that may be used if the func lowering pass is
|
||||
// not used. It is generally too slow but may be a useful fallback to debug the
|
||||
// func lowering pass.
|
||||
func getFuncPtr(val funcValue, signature *uint8) uintptr {
|
||||
func getFuncPtr(val funcValue, signature *typecodeID) uintptr {
|
||||
return (*funcValueWithSignature)(unsafe.Pointer(val.id)).funcPtr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user