Skip to content

Commit

Permalink
Fix crash with type interface in function parameters. Issue #1108 (#1111
Browse files Browse the repository at this point in the history
)
  • Loading branch information
NikLeberg authored Dec 22, 2024
1 parent 273e2f5 commit fb6875c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5533,7 +5533,8 @@ static void p_interface_type_declaration(tree_t parent, tree_kind_t kind)
// immediately following the interface type declaration in the
// enclosing interface list

declare_generic_ops(parent, type);
if (kind == T_GENERIC_DECL)
declare_generic_ops(parent, type);
}

static void p_formal_parameter_list(tree_t decl, type_t type)
Expand Down
9 changes: 9 additions & 0 deletions test/parse/vhdl2008.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,13 @@ begin
begin
proc(x => inertial x); -- Error
end block;

b12: block is
function fact generic (
function foo( type t ) return natural -- Error
) return natural is
begin
end function;
begin
end block;
end architecture;
3 changes: 2 additions & 1 deletion test/test_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3626,7 +3626,8 @@ START_TEST(test_vhdl2008)
{ 264, "signed bit string literal cannot be an empty string" },
{ 282, "the reserved word INERTIAL can only be used in port map " },
{ 290, "the reserved word INERTIAL can only be used in port map " },
{ -1, NULL }
{ 295, "parameter interface list cannot contain type interface " },
{ -1, NULL }
};
expect_errors(expect);

Expand Down

0 comments on commit fb6875c

Please sign in to comment.