diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-05-14 16:21:19 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-05-14 19:28:01 +0200 |
| commit | 2376f0f937b8e6b457ef1fdf088b8b7059dcb0e2 (patch) | |
| tree | 6a66d085190a488475a843ec8a138fd6a3c8e8a1 /docs/syscall_descriptions_syntax.md | |
| parent | 9a4969814ea6a65b306ca7d3192c23381c778ad4 (diff) | |
pkg/compiler: allow to refer to syscall arguments in len paths
This allows to use len[syscall:arg] expressions.
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 14 |
1 files changed, 10 insertions, 4 deletions
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 |
