mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
compiler: fix interface lowering miscompilation with reflect
When using reflect, arbitrary types can be synthesized. This invalidates a few assumptions in the interface-lowering pass, that think they can see all types that are in use in a program and optimize accordingly. The file size impact depends on the specific program. Sometimes it's nonexistent, sometimes it's rather hefty (up to 30% bigger). Especially the samd21 targets seem to be affected, with a 2000-6000 bytes increase in code size. A moderately large case (the stdlib test) increases by 4%/6%/15% depending on the target. I hope that this increase could be mitigated, but I don't see an obvious way to do that.
This commit is contained in:
committed by
Jaden Weiss
parent
4339cbd56f
commit
a7794de99d
Vendored
+1
@@ -335,3 +335,4 @@ float32 4 32
|
||||
float64 8 64
|
||||
complex64 8 64
|
||||
complex128 16 128
|
||||
type assertion succeeded for unreferenced type
|
||||
|
||||
Reference in New Issue
Block a user