From 2376f0f937b8e6b457ef1fdf088b8b7059dcb0e2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 14 May 2019 16:21:19 +0200 Subject: pkg/compiler: allow to refer to syscall arguments in len paths This allows to use len[syscall:arg] expressions. --- pkg/compiler/testdata/all.txt | 3 ++- pkg/compiler/testdata/errors2.txt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/compiler/testdata') diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 7acb47743..25461ff9a 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -72,6 +72,7 @@ foo$len_var1(a ptr[in, array[string]], b ptr[in, len[a, int32]]) len_expr1 { f11 len_expr2 + f12 bytesize[syscall:b, int32] } len_expr2 { @@ -95,7 +96,7 @@ len_expr4 { f41 int32 } -foo$len_expr(a ptr[in, len_expr1]) +foo$len_expr(a ptr[in, len_expr1], b ptr[in, array[int8, 3]]) # Pointer type. diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 6b7737ef5..311be3ea9 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -145,6 +145,8 @@ slen1 { f3 len[f0:parent, int32] ### parent can't be part of path expressions f4 len[slen2:f, int32] ### len path slen2 does not refer to a struct f5 len[slen22:f, int32] ### len path slen22 does not refer to a struct + f6 len[syscall, int32] ### no argument name after syscall reference + f7 len[syscall:b, int32] ### len target b does not exist slen2 ptr[in, array[slen2]] slen21 slen2 slen22 array[slen2] -- cgit mrf-deployment