summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-02-12 14:36:52 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-02-12 14:36:52 -0500
commit4ddbaf8a44e4bf46d3ebe3c5afc957ecd07cfa0a (patch)
tree0a7931c79ea13b9032a8e4958f88024b084feacc /src/eval.c
parenta98fe72db88350fcec030487208e6c50c9de1974 (diff)
downloadbfs-4ddbaf8a44e4bf46d3ebe3c5afc957ecd07cfa0a.tar.xz
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'
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index a4c0c11..6d7afad 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1085,7 +1085,7 @@ bool eval_or(const struct bfs_expr *expr, struct bfs_eval *state) {
* Evaluate the comma operator.
*/
bool eval_comma(const struct bfs_expr *expr, struct bfs_eval *state) {
- bool ret = uninit(ret, false);
+ bool ret uninit(false);
for (struct bfs_expr *child = bfs_expr_children(expr); child; child = child->next) {
ret = eval_expr(child, state);