From dd3bbb976be76325f4115f9f0ef51b3e6dde75c5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 9 Nov 2020 17:01:33 -0500 Subject: opt: Predicates aren't true when they're false This unfortunate typo was mostly harmless; since the predicates were always assumed to be true, they wouldn't conflict. The exception is -user/-group, which set -nouser/-nogroup to false for users/groups that exist. Even -O0 wasn't enough to suppress the bug, due to a missing optlevel check fixed in the previous commit. Fixes: 305ee902874b49351f4916e303c293523f11570b --- opt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opt.c') diff --git a/opt.c b/opt.c index 8c516ea..50ad212 100644 --- a/opt.c +++ b/opt.c @@ -1,6 +1,6 @@ /**************************************************************************** * bfs * - * Copyright (C) 2017-2019 Tavian Barnes * + * Copyright (C) 2017-2020 Tavian Barnes * * * * Permission to use, copy, modify, and/or distribute this software for any * * purpose with or without fee is hereby granted. * @@ -712,7 +712,7 @@ fail: /** Infer data flow facts about a predicate. */ static void infer_pred_facts(struct opt_state *state, enum pred_type pred) { constrain_pred(&state->facts_when_true.preds[pred], true); - constrain_pred(&state->facts_when_false.preds[pred], true); + constrain_pred(&state->facts_when_false.preds[pred], false); } /** Infer data flow facts about an -{execut,read,writ}able expression. */ -- cgit v1.2.3