Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fuzz] Fix crash with type interface in function parameters. Issue #1108 #1111

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading