From b184e05aada74f34dafd9d1bf6bc24e68ab76e05 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Sun, 7 Aug 2016 14:57:22 +0200 Subject: 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. --- cparser/Elab.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cparser') 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 -- cgit