transform: fix incorrect alignment of heap-to-stack transform

It assumed the maximum alignment was equal to sizeof(void*), which is
definitely not the case. So this only worked more or less by accident
previously.

It now uses the alignment as specified by the frontend, or else
`unsafe.Alignof(complex128)` which is typically the maximum alignment of
a given platform (though this shouldn't really happen in practice: the
optimizer should keep the 'align' attribute in place).
This commit is contained in:
Ayke van Laethem
2024-06-25 20:14:05 +02:00
committed by Ron Evans
parent 571447c7c1
commit e6caa3fe9e
5 changed files with 62 additions and 31 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ require (
golang.org/x/sys v0.21.0
golang.org/x/tools v0.22.1-0.20240621165957-db513b091504
gopkg.in/yaml.v2 v2.4.0
tinygo.org/x/go-llvm v0.0.0-20240518103902-697964f2a9dc
tinygo.org/x/go-llvm v0.0.0-20240627184919-3b50c76783a8
)
require (