From 23a1a1aacc0dd14767ca8c53a034b7c6bb4acf52 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 6 Aug 2024 20:01:54 -0400 Subject: [parser] Fix bug when printing type builder errors (#6817) The type index from the TypeBuilder error was mapped to a file location incorrectly, resulting in an assertion failure. Fixes #6816. --- test/lit/parse-bad-supertype-8616.wast | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/lit/parse-bad-supertype-8616.wast (limited to 'test') diff --git a/test/lit/parse-bad-supertype-8616.wast b/test/lit/parse-bad-supertype-8616.wast new file mode 100644 index 000000000..c7c3dc957 --- /dev/null +++ b/test/lit/parse-bad-supertype-8616.wast @@ -0,0 +1,11 @@ +;; RUN: not wasm-opt %s 2>&1 | filecheck %s + +;; CHECK: Fatal: 9:2: error: invalid type: Heap type has an undeclared supertype + +;; Regression test for a parser bug that caused an assertion failure in this case. +(module + (rec + (type $A (sub (struct (field i32)))) + (type $B (sub $B (struct (field i32) (field i32)))) + ) +) \ No newline at end of file -- cgit v1.2.3