From 4b2c8f05fa84b5d05ab3d83ebf190236d1b71561 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 12 Aug 2024 16:59:44 -0400 Subject: opt: Add a missing NULL check in lift_andor_not() The annotation visitor probably can't fail, but we might as well check consistently. --- src/opt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/opt.c b/src/opt.c index 2609c77..842d27c 100644 --- a/src/opt.c +++ b/src/opt.c @@ -1980,6 +1980,10 @@ static struct bfs_expr *lift_andor_not(struct bfs_opt *opt, struct bfs_expr *exp } expr = visit_shallow(opt, expr, &annotate); + if (!expr) { + return NULL; + } + return negate_expr(opt, expr, &fake_not_arg); } -- cgit v1.2.3