aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--Documentation/release-notes/v0.6.3.rst5
-rw-r--r--Makefile2
-rw-r--r--evaluate.c2
-rw-r--r--validation/crash-undef-in-parens.c9
4 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/release-notes/v0.6.3.rst b/Documentation/release-notes/v0.6.3.rst
index 521c0063..7ec59eff 100644
--- a/Documentation/release-notes/v0.6.3.rst
+++ b/Documentation/release-notes/v0.6.3.rst
@@ -1,5 +1,5 @@
-v0.6.3 (Fall 2020)
-==================
+v0.6.3 (2020-10-17)
+===================
Bug fixes:
* fix missing inlining of _Generic expression
@@ -15,6 +15,7 @@ Bug fixes:
* fix access to defining instruction in simplify_unop()
* fix evaluation of pointer to bool conversions
* fix usual conversion of integers
+ * fix null pointer deref on return expression with invalid type
New features:
* add support for arch specific asm constraints
diff --git a/Makefile b/Makefile
index f7da0ded..31366446 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.6.3-rc1
+VERSION=0.6.3
########################################################################
# The following variables can be overwritten from the command line
diff --git a/evaluate.c b/evaluate.c
index d7420252..43a61169 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -3615,7 +3615,7 @@ static struct symbol *evaluate_return_expression(struct statement *stmt)
fntype = current_fn->ctype.base_type;
rettype = fntype->ctype.base_type;
if (!rettype || rettype == &void_ctype) {
- if (expr && !is_void_type(expr->ctype))
+ if (expr && expr->ctype && !is_void_type(expr->ctype))
expression_error(expr, "return expression in %s function", rettype?"void":"typeless");
if (expr && Wreturn_void)
warning(stmt->pos, "returning void-valued expression");
diff --git a/validation/crash-undef-in-parens.c b/validation/crash-undef-in-parens.c
new file mode 100644
index 00000000..5f05f88a
--- /dev/null
+++ b/validation/crash-undef-in-parens.c
@@ -0,0 +1,9 @@
+void foo(void) { return (UNDEF_STUFF_IN_PARENS); }
+
+/*
+ * check-name: crash-undef-in-parens
+ *
+ * check-error-start
+crash-undef-in-parens.c:1:26: error: undefined identifier 'UNDEF_STUFF_IN_PARENS'
+ * check-error-end
+ */