summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-08-12 16:59:44 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-08-12 16:59:44 -0400
commit4b2c8f05fa84b5d05ab3d83ebf190236d1b71561 (patch)
tree4469788d95c3ee9b15c4eefdabe40a06387f0682 /src
parent1234d764ba3059eb2314cb50a2790240ed7ac630 (diff)
downloadbfs-4b2c8f05fa84b5d05ab3d83ebf190236d1b71561.tar.xz
opt: Add a missing NULL check in lift_andor_not()
The annotation visitor probably can't fail, but we might as well check consistently.
Diffstat (limited to 'src')
-rw-r--r--src/opt.c4
1 files changed, 4 insertions, 0 deletions
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);
}