Menu

#59 ASSERT_FAILURE with overloaded subprogram call having record field suffix.

1.0
closed
None
2015-05-12
2015-05-12
No

bug.vhd:

package pkg is
  type rec0_t is record
    field0 : boolean;
  end record;

  type rec1_t is record
    field1 : boolean;
  end record;

  function fun(val : boolean) return rec0_t;
  function fun(val : boolean) return rec1_t;
  function fun(val : boolean) return boolean;

  procedure proc;
end package;

package body pkg is
  function fun(val : boolean) return rec0_t is
  begin
    return (field0 => val);
  end function;

  function fun(val : boolean) return rec1_t is
  begin
    return (field1 => val);
  end function;

  function fun(val : boolean) return boolean is
  begin
    return val;
  end function;

  procedure proc is
  begin
    assert fun(true).field0;
    assert fun(true).field1;
    assert fun(true);
  end procedure;

end package body;

command line output:

ghdl -a bug.vhd 

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.33dev (20141104) [Dunoon edition]
Compiled with GNAT Version: 4.8
In directory: /home/kraigher/repo/ghdl_bugs/
Command line:
/opt/ghdl/bin/ghdl1-llvm -P/opt/ghdl/lib/ghdl/v93/std/ -P/opt/ghdl/lib/ghdl/v93/ieee/ -c -o bug.o bug.vhd
Exception SYSTEM.ASSERTIONS.ASSERT_FAILURE raised
Exception information:
Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE
Message: no field Is_Within_Flag
Call stack traceback locations:
0x7f635a8dd901 0x465cb7 0x5c9547 0x5c889c 0x5cf56f 0x5de239 0x5debcf 0x5df091 0x5b7fc5 0x5b960c 0x5b96fe 0x5f3dea 0x5e691a 0x5f6301 0x5f73da 0x55a182 0x5ab8fc 0x476b1c 0x432e75 0x7f635a0f8ec3 0x432300 0xfffffffffffffffe
******************************************************************
ghdl: compilation error

Modelsim does not complain. NVC thinks it is ambiguous.

Discussion

  • Tristan Gingold

    Tristan Gingold - 2015-05-12

    Oversight fixed.

    Thanks!
    Tristan.

     
  • Tristan Gingold

    Tristan Gingold - 2015-05-12
    • status: open --> closed
    • assigned_to: Tristan Gingold
     

Log in to post a comment.