From 4dfba277487a7023ab9f5783302da4a9b5e9bef8 Mon Sep 17 00:00:00 2001 From: "Jiao, Joey" Date: Wed, 6 Nov 2024 13:41:21 +0800 Subject: all: support || operator in syzlang if condition ex. f3 field has logic or operator in if condition: conditional_struct { mask int32 f1 field1 (if[value[mask] & FIELD_FLAG1]) f2 int64 (if[value[mask] & FIELD_FLAG2]) f3 int64 (if[value[mask] == FIELD_FLAG1 || value[mask] == FIELD_FLAG2]) } [packed] --- docs/syscall_descriptions_syntax.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 9ffc827dc..63c86cc93 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -543,7 +543,7 @@ whose condition is satisfied. ### Expression syntax -Currently, only `==`, `!=` and `&` operators are supported. However, the +Currently, only `==`, `!=`, `&` and `||` operators are supported. However, the functionality was designed in such a way that adding more operators is easy. Feel free to file a GitHub issue or write us an email in case it's needed. @@ -565,6 +565,7 @@ struct { f3 sub_struct f4 int (if[value[f2] == 0x2]) # Reference a sibling field. f5 int (if[value[f3:f0] == 0x1]) # Reference a nested field. + f6 int (if[value[f3:f0] == 0x1 || value[f3:f0] == 0x2]) # Reference a nested field which either equals to 0x1 or 0x2. } [packed] call(a ptr[in, struct]) -- cgit mrf-deployment