aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler
diff options
context:
space:
mode:
authorJiao, Joey <quic_jiangenj@quicinc.com>2024-11-06 13:41:21 +0800
committerAleksandr Nogikh <nogikh@google.com>2024-11-13 11:16:59 +0000
commit4dfba277487a7023ab9f5783302da4a9b5e9bef8 (patch)
tree72c5a0b86f7e38922230b4421ebe50c5654e5cdc /pkg/compiler
parentbb3f84250514d5990939e57b5d1ff8badc566033 (diff)
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]
Diffstat (limited to 'pkg/compiler')
-rw-r--r--pkg/compiler/gen.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/compiler/gen.go b/pkg/compiler/gen.go
index 891cd1644..104c2899b 100644
--- a/pkg/compiler/gen.go
+++ b/pkg/compiler/gen.go
@@ -608,6 +608,7 @@ var binaryOperatorMap = map[ast.Operator]prog.BinaryOperator{
ast.OperatorCompareEq: prog.OperatorCompareEq,
ast.OperatorCompareNeq: prog.OperatorCompareNeq,
ast.OperatorBinaryAnd: prog.OperatorBinaryAnd,
+ ast.OperatorOr: prog.OperatorOr,
}
func (comp *compiler) genExpression(t *ast.Type) prog.Expression {