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. --- docs/syscall_descriptions_syntax.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'docs/syscall_descriptions_syntax.md') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index e3318d300..25b0e0e65 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -252,7 +252,9 @@ s2 { `len` argument can also be a path expression which allows more complex addressing. Path expressions are similar to C field references, but also allow -referencing parent and sibling elements. For example: +referencing parent and sibling elements. A special reference `syscall` used +in the beginning of the path allows to refer directly to the syscall arguments. +For example: ``` s1 { @@ -271,13 +273,17 @@ s3 { # This refers to the array d in the sibling s2. f len[s1:a:d, int32] # This refers to the array k in the child s4. - g len[h:i, int32] - h ptr[in, s4] + g len[i:j, int32] +# This refers to syscall argument l. + h len[syscall:l, int32] + i ptr[in, s4] } s4 { - i array[int8] + j array[int8] } + +foo(k ptr[in, s1], l ptr[in, array[int8]]) ``` ## Proc -- cgit mrf-deployment