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] --- pkg/ast/format.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/ast/format.go') diff --git a/pkg/ast/format.go b/pkg/ast/format.go index 4b54466c2..b16a62531 100644 --- a/pkg/ast/format.go +++ b/pkg/ast/format.go @@ -273,6 +273,8 @@ func fmtExpressionRec(sb *strings.Builder, t *Type, parentPrio int) { sb.WriteString("!=") case OperatorBinaryAnd: sb.WriteString("&") + case OperatorOr: + sb.WriteString("||") default: panic(fmt.Sprintf("unknown operator %q", be.Operator)) } -- cgit mrf-deployment