diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-04 19:45:11 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-04 19:45:11 +0100 |
commit | b91a9fbbef7328f6f041f4ddda01dbbd7e156cfb (patch) | |
tree | 6d4c7a0394ae113b0533c7a739f544a7b269d8a3 /src | |
parent | 9aaa456a729e34430b975fee05d766ce070e2d70 (diff) | |
download | ghdl-b91a9fbbef7328f6f041f4ddda01dbbd7e156cfb.tar.gz ghdl-b91a9fbbef7328f6f041f4ddda01dbbd7e156cfb.tar.bz2 ghdl-b91a9fbbef7328f6f041f4ddda01dbbd7e156cfb.zip |
elab-vhdl_debug: avoid a crash on error in print
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/elab-vhdl_debug.adb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb index 1ea810734..9b0a25454 100644 --- a/src/synth/elab-vhdl_debug.adb +++ b/src/synth/elab-vhdl_debug.adb @@ -1377,14 +1377,18 @@ package body Elab.Vhdl_Debug is -- Res := Execute_Name (Dbg_Cur_Frame, Expr, True); raise Internal_Error; else + -- TODO: check EXPR is an expression. + -- TODO: protected object. Res := Synth.Vhdl_Expr.Synth_Expression (Cur_Inst, Expr); end if; - if Res.Val.Kind = Value_Memory then - Disp_Memtyp (Get_Memtyp (Res), Get_Type (Expr)); - else - Elab.Vhdl_Values.Debug.Debug_Valtyp (Res); + if Res /= No_Valtyp then + if Res.Val.Kind = Value_Memory then + Disp_Memtyp (Get_Memtyp (Res), Get_Type (Expr)); + else + Elab.Vhdl_Values.Debug.Debug_Valtyp (Res); + end if; + New_Line; end if; - New_Line; -- Free value Release_Expr_Pool (Marker); |