aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--evaluate.c1
-rw-r--r--validation/cond-address.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index f2d95c79..97685791 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -881,6 +881,7 @@ static struct symbol *evaluate_conditional(struct expression *expr, int iterator
ctype = NULL;
}
}
+ ctype = degenerate(expr);
return ctype;
}
diff --git a/validation/cond-address.c b/validation/cond-address.c
new file mode 100644
index 00000000..2a69f4b9
--- /dev/null
+++ b/validation/cond-address.c
@@ -0,0 +1,14 @@
+extern void f(void);
+extern int a[];
+
+int foo(void) { if (f) return 1; return 0; }
+int bar(void) { if (a) return 1; return 0; }
+int qux(void) { if (f && a) return 1; return 0; }
+
+/*
+ * check-name: cond-address.c
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-excludes: VOID
+ */