From 7a211109152e82843a59ba70b0a080ce91b9b495 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 Apr 2020 08:07:17 +0200 Subject: grt: handle argc=0 in ghdl_main. Fix #1206 --- src/grt/ghdl_main.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/grt/ghdl_main.adb b/src/grt/ghdl_main.adb index c36e1b851..3107da23c 100644 --- a/src/grt/ghdl_main.adb +++ b/src/grt/ghdl_main.adb @@ -45,12 +45,18 @@ is (Source => System.Address, Target => Grt.Options.Argv_Type); My_Argv : Grt.Options.Argv_Type := To_Argv_Type (Argv); + Progname : Ghdl_C_String; begin -- Ada elaboration. Grt_Init; -- Set the options. - Grt.Main.Run_Options (My_Argv (0), Argc, My_Argv); + if Argc > 0 then + Progname := My_Argv (0); + else + Progname := null; + end if; + Grt.Main.Run_Options (Progname, Argc, My_Argv); -- Initialize, elaborate and simulate. Grt.Main.Run; -- cgit v1.2.3