mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
reflect: add support for linked lists
Linked lists are usually implemented as follows:
type linkedList struct {
next *linkedList
data int // whatever
}
This caused a stack overflow while writing out the reflect run-time type
information. This has now been fixed by splitting the allocation of a
named type number from setting the underlying type in the sidetable.
This commit is contained in:
committed by
Ron Evans
parent
0818a125c0
commit
ea8e4079bc
Vendored
+16
@@ -293,6 +293,22 @@ reflect type: struct
|
||||
indexing: 0
|
||||
reflect type: uint8 settable=true
|
||||
uint: 88
|
||||
reflect type: ptr
|
||||
pointer: true struct
|
||||
nil: false
|
||||
reflect type: struct settable=true
|
||||
struct: 2
|
||||
field: 0 next
|
||||
tag: description:"chain"
|
||||
embedded: false
|
||||
reflect type: ptr
|
||||
pointer: false struct
|
||||
nil: true
|
||||
field: 1 foo
|
||||
tag:
|
||||
embedded: false
|
||||
reflect type: int
|
||||
int: 42
|
||||
|
||||
sizes:
|
||||
int8 1 8
|
||||
|
||||
Reference in New Issue
Block a user