Skip to content

Crash when missing new keyword in generic package declaration #1202

@maltaisn

Description

@maltaisn

The following:

entity foo is
    generic (
        package pkg is work.my_package generic map (<>));
end entity;

architecture rtl of foo is

    use pkg.all;

begin

end architecture;

Causes a crash on elaboration with the following output:

nvc --std=2019 -a src/my_package.vhd src/foo.vhd
** Error: unexpected identifier while parsing interface package declaration, expecting new
   > src/foo.vhd:6
   |
 6 |         package pkg is work.my_package generic map (<>));
   |                        ^^^^ this token was unexpected

*** Caught signal 11 (SEGV_MAPERR) [address=(nil), ip=0x574ae4b09a95] ***

[0x574ae4a44655] ../src/util.c:906 signal_handler.lto_priv.0
[0x7488dba4532f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x574ae4b09a95] ../src/tree.c:1009 insert_names_from_use.part.0
[0x574ae4a4e97e] ../src/names.c:2331 p_use_clause.lto_priv.0
[0x574ae4a6dab2] ../src/parse.c:8217 p_entity_declaration
[0x574ae4a6dab2] ../src/parse.c:9525 p_primary_unit.lto_priv.0
[0x574ae4a799b1] ../src/parse.c:13636 p_design_unit
[0x574ae4a799b1] ../src/parse.c:13756 parse
[0x574ae4ab83a3] ../src/common.c:2529 analyse_file
[0x574ae4a3d05f] ../src/nvc.c:279 analyse
[0x574ae4a3d05f] ../src/nvc.c:2428 process_command
[0x574ae4a37dea] ../src/nvc.c:2600 main

nvc 1.16.0 (Using LLVM 18.1.3) [x86_64-pc-linux-gnu]

Adding the new keyword fixes it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions