diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-04-06 08:19:08 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-04-06 08:19:08 +0200 |
commit | 7b3fabe10aecac99d8b4f4360c414333ee909197 (patch) | |
tree | 6e0e2efe92239a2f4ff6618034149a3db96edb3d /src | |
parent | b7faacf0ec468e2bc2d496739df36d991f102630 (diff) | |
download | ghdl-7b3fabe10aecac99d8b4f4360c414333ee909197.tar.gz ghdl-7b3fabe10aecac99d8b4f4360c414333ee909197.tar.bz2 ghdl-7b3fabe10aecac99d8b4f4360c414333ee909197.zip |
synth-vhdl_stmts: emit an error message on missing return. Fix #2019
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-vhdl_stmts.adb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb index c715ba153..114d98ec1 100644 --- a/src/synth/synth-vhdl_stmts.adb +++ b/src/synth/synth-vhdl_stmts.adb @@ -2031,7 +2031,9 @@ package body Synth.Vhdl_Stmts is else if Is_Func then if C.Nbr_Ret = 0 then - raise Internal_Error; + Error_Msg_Synth + (+Bod, "missing return statement at end of function"); + Res := No_Valtyp; elsif C.Nbr_Ret = 1 and then Is_Static (C.Ret_Value.Val) then Res := C.Ret_Value; else |