aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-08-07 14:57:22 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-08-07 14:57:22 +0200
commitb184e05aada74f34dafd9d1bf6bc24e68ab76e05 (patch)
tree378e2a1654316a99b2ace1e7329969a7f5a345ff /cparser
parent4ac759d0bceef49d16197e3bb8c9767ece693c5e (diff)
downloadcompcert-b184e05aada74f34dafd9d1bf6bc24e68ab76e05.tar.gz
compcert-b184e05aada74f34dafd9d1bf6bc24e68ab76e05.zip
Exit earlier on wrong return types.
Return with a expression that is not compatible with the given return type of a function now causes and fatal error, to avoid problems with later transformation passes depending on it.
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Elab.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index 76f8efdb..67b23d91 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -2361,7 +2361,7 @@ let rec elab_stmt env ctx s =
instead of the expected type@ %a"
Cprint.typ b.etyp Cprint.typ ctx.ctx_return_typ
else
- error loc
+ fatal_error loc
"return value has type@ %a@ \
instead of the expected type@ %a"
Cprint.typ b.etyp Cprint.typ ctx.ctx_return_typ