aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorMartin Nagy <nagy.martin@gmail.com>2009-04-27 10:48:50 +0200
committerChristopher Li <sparse@chrisli.org>2009-07-18 05:30:10 +0000
commit78798b4f946a37b1ffbbc6853765e479eca553e8 (patch)
treed78f2b908a585aa74e7e4a5edcb0249cc6b3cdc0 /validation
parent909d306e74e73a40aab10dcbe26261fb381a30b2 (diff)
downloadsparse-dev-78798b4f946a37b1ffbbc6853765e479eca553e8.tar.gz
Print an error if typeof() lacks an argument
We weren't checking if the initializer isn't NULL, which caused sparse to segfault later on when performing lazy evaluation in classify_type(). Signed-off-by: Martin Nagy <nagy.martin@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/bad-typeof.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/validation/bad-typeof.c b/validation/bad-typeof.c
new file mode 100644
index 00000000..90c3e424
--- /dev/null
+++ b/validation/bad-typeof.c
@@ -0,0 +1,14 @@
+static int fun(void)
+{
+ typeof() a;
+ int b;
+
+ a = b;
+}
+/*
+ * check-name: Bad typeof syntax segfault
+ *
+ * check-error-start
+bad-typeof.c:3:16: error: expected expression after the '(' token
+ * check-error-end
+ */