Message ID | 20230320103809.3121679-3-i.maximets@ovn.org |
---|---|
State | Changes Requested |
Headers | show |
Series | expr: Optimize OR expressions. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/github-robot-_ovn-kubernetes | success | github build: passed |
diff --git a/lib/expr.c b/lib/expr.c index f9f3b6991..d881e07f7 100644 --- a/lib/expr.c +++ b/lib/expr.c @@ -2879,7 +2879,7 @@ expr_sort(struct expr *expr) } free(subs); - return expr; + return expr ? expr : expr_create_boolean(true); } static struct expr *expr_normalize_or(struct expr *expr);
expr_sort() can potentially return NULL if all sub-expressions got crushed into 'true'. This didn't happen before, but can happen with more aggressive optimizations in crush_or(). Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- lib/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)