[ovs-dev] [PATCH 13/30] expr: Tolerate having no macros.

Ben Pfaff blp at ovn.org
Mon Aug 8 07:44:52 UTC 2016


A null set of macros seems reasonable, so tolerate it.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 ovn/lib/expr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c
index cb61b5d..050e694 100644
--- a/ovn/lib/expr.c
+++ b/ovn/lib/expr.c
@@ -735,7 +735,9 @@ parse_macros(struct expr_context *ctx, struct expr_constant_set *cs,
              size_t *allocated_values)
 {
     struct expr_constant_set *addr_set
-        = shash_find_data(ctx->macros, ctx->lexer->token.s);
+        = (ctx->macros
+           ? shash_find_data(ctx->macros, ctx->lexer->token.s)
+           : NULL);
     if (!addr_set) {
         expr_syntax_error(ctx, "expecting address set name.");
         return false;
-- 
2.1.3




More information about the dev mailing list