compiler: fix stack overflow when creating recursive pointer types

There were two types that could result in a compiler stack overflow.
This is difficult to fix in LLVM 14, so I won't even bother. However,
this is trivial to fix with opaque pointers in LLVM 15. Therefore, this
fix is for LLVM 15 only.

Fixes: https://github.com/tinygo-org/tinygo/issues/3341
This commit is contained in:
Ayke van Laethem
2022-12-22 00:48:12 +00:00
committed by Ron Evans
parent 481aba6536
commit 9fd0567fb5
4 changed files with 22 additions and 6 deletions
+2
View File
@@ -7,6 +7,8 @@ target triple = "wasm32-unknown-wasi"
%main.kv.0 = type { i8, i32, i32, i32 }
@main.kvGlobal = hidden global %main.kv zeroinitializer, align 4
@main.a = hidden global { ptr, i32, i32 } zeroinitializer, align 4
@main.b = hidden global [2 x ptr] zeroinitializer, align 4
declare noalias nonnull ptr @runtime.alloc(i32, ptr, ptr) #0