From 3d76cc40d99e9f984db1ecc9310a8ea2004ec901 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 23 Jan 2018 11:38:53 +0100 Subject: pkg/compiler: fix len of parent template struct Consider the following example: type len_templ1[DATA1, DATA2] { data DATA1 inner len_temp2[DATA2] } type len_temp2[DATA] { data DATA len len[len_templ1, int8] } Here len refers to a parent struct, but the struct is a template, so it's actual name is something like "len_templ1[int8, int16]". Currently this does not work as compiler barks at incorrect len target. Make this work. --- sys/test/test.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys/test/test.txt') diff --git a/sys/test/test.txt b/sys/test/test.txt index f8a1e4fba..051c17ce6 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -338,6 +338,18 @@ syz_length_parent2_struct { f2 len[syz_length_parent2_struct, int8] } +type len_templ1[DATA1, DATA2] { + data DATA1 + inner len_temp2[DATA2] +} + +type len_temp2[DATA] { + data DATA + len len[len_templ1, int8] +} + +syz_test$length23(a ptr[in, len_templ1[int8, int16]]) + # Big endian syz_test$end0(a0 ptr[in, syz_end_int_struct]) -- cgit mrf-deployment