diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-06 16:21:47 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-06 16:21:47 +0200 |
commit | 173bc379a93dd7de950557782bcc9f2b0a137ca9 (patch) | |
tree | d77225778265b1019d7314676c9dc65e21943894 | |
parent | 4073a0be10c0cf14c87f3f19fc3baf594148149c (diff) | |
download | ghdl-173bc379a93dd7de950557782bcc9f2b0a137ca9.tar.gz ghdl-173bc379a93dd7de950557782bcc9f2b0a137ca9.tar.bz2 ghdl-173bc379a93dd7de950557782bcc9f2b0a137ca9.zip |
ghdlsynth: fix crash when using libghdl.
-rw-r--r-- | src/errorout.adb | 4 | ||||
-rw-r--r-- | src/ghdldrv/ghdlsynth.adb | 2 | ||||
-rw-r--r-- | src/synth/synthesis.adb | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/errorout.adb b/src/errorout.adb index d3eea84c3..ab05c956a 100644 --- a/src/errorout.adb +++ b/src/errorout.adb @@ -229,7 +229,9 @@ package body Errorout is procedure Register_Earg_Handler (Kind : Earg_Kind; Handler : Earg_Handler) is begin - if Lang_Handlers (Kind) /= null then + if Lang_Handlers (Kind) /= null + and then Lang_Handlers (Kind) /= Handler + then -- Cannot change handler. raise Internal_Error; end if; diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index 27af66d97..27694e26e 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -42,6 +42,7 @@ with Vhdl.Utils; with Netlists.Dump; with Netlists.Disp_Vhdl; +with Netlists.Errors; with Synthesis; with Synth.Disp_Vhdl; @@ -350,5 +351,6 @@ package body Ghdlsynth is Ghdlsynth.Register_Commands; Options.Initialize; Errorout.Console.Install_Handler; + Netlists.Errors.Initialize; end Init_For_Ghdl_Synth; end Ghdlsynth; diff --git a/src/synth/synthesis.adb b/src/synth/synthesis.adb index d5dcf61fd..5d41ad70f 100644 --- a/src/synth/synthesis.adb +++ b/src/synth/synthesis.adb @@ -20,7 +20,6 @@ with Vhdl.Utils; use Vhdl.Utils; -with Netlists.Errors; with Synth.Values; use Synth.Values; with Synth.Decls; use Synth.Decls; with Synth.Insts; use Synth.Insts; @@ -128,7 +127,6 @@ package body Synthesis is Top_Instance := Make_Base_Instance; - Netlists.Errors.Initialize; Synth.Values.Init; Synth.Insts.Init; |