From 4ddbaf8a44e4bf46d3ebe3c5afc957ecd07cfa0a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 12 Feb 2024 14:36:52 -0500 Subject: sanity: Don't use self-init for uninit() Self-initialization like bool ret = ret; is a GCC trick to suppress uninitialized variable warnings, but it's not actually well-defined, and will trip a recent enough MemorySanitizer: src/eval.c:1088:13: runtime error: load of value 128, which is not a valid value for type 'bool' --- src/parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/parse.c') diff --git a/src/parse.c b/src/parse.c index 3a78840..5d0f333 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1891,11 +1891,11 @@ static int parse_mode(const struct bfs_parser *parser, const char *mode, struct MODE_PLUS, MODE_MINUS, MODE_EQUALS, - } op = uninit(op, MODE_EQUALS); + } op uninit(MODE_EQUALS); - mode_t who = uninit(who, 0); - mode_t file_change = uninit(file_change, 0); - mode_t dir_change = uninit(dir_change, 0); + mode_t who uninit(0); + mode_t file_change uninit(0); + mode_t dir_change uninit(0); const char *i = mode; while (true) { -- cgit v1.2.3