aboutsummaryrefslogtreecommitdiffstats
path: root/prog/size_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-23 11:38:53 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-23 11:38:53 +0100
commit3d76cc40d99e9f984db1ecc9310a8ea2004ec901 (patch)
treef80644ea1b67d6a9d9c5475c7d3737082c866102 /prog/size_test.go
parent14d1e424b6a582d021c73c88e1f0c5f0962ecc9d (diff)
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.
Diffstat (limited to 'prog/size_test.go')
-rw-r--r--prog/size_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/prog/size_test.go b/prog/size_test.go
index 9c76d05f6..8f472491d 100644
--- a/prog/size_test.go
+++ b/prog/size_test.go
@@ -126,6 +126,10 @@ func TestAssignSize(t *testing.T) {
"syz_test$length22(&(0x7f0000000000)='12345', 0x0)",
"syz_test$length22(&(0x7f0000000000)='12345', 0x28)",
},
+ {
+ "syz_test$length23(&(0x7f0000000000)={0x1, {0x2, 0x0}})",
+ "syz_test$length23(&(0x7f0000000000)={0x1, {0x2, 0x6}})",
+ },
}
for i, test := range tests {