aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-10-10 11:55:52 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-10-10 11:57:33 +0200
commita4efa8c091bb41968c2a2e198fa239625ed8a24e (patch)
tree902e952ce0abf2eb06d757f9587497e14ef29a56 /pkg/compiler/compiler_test.go
parentd52eff2843084b3aeada4e46029519cf17067385 (diff)
pkg/compiler: fix infinite recursion in template instantiation
Currently we replace a template argument and then recurse into the new type AST to see if there is more to replace. If the description is buggy and the template argument contains itself, then we will recurse infintiely trying to replace it more and more. Use post-order traversal when replacing template argument to fix this.
Diffstat (limited to 'pkg/compiler/compiler_test.go')
-rw-r--r--pkg/compiler/compiler_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go
index 8f10ac586..4ea5b2721 100644
--- a/pkg/compiler/compiler_test.go
+++ b/pkg/compiler/compiler_test.go
@@ -201,6 +201,11 @@ l t
type D[e]l`,
"E",
"#",
+ `
+type p b[L]
+type b[L] {
+ e b[L[L]]
+}`,
} {
Fuzz([]byte(data)[:len(data):len(data)])
}