Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Fix Bug 146 - ICE in TypeFunction::toCtype
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jul 23, 2014
1 parent 553a30c commit 5434139
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-07-23 Iain Buclaw <ibuclaw@gdcproject.org>

* d-ctype.cc(TypeFunction::toCtype): Only check for ref return for
functions returning non-void.

2014-07-21 Iain Buclaw <ibuclaw@gdcproject.org>

* d-objfile.cc(output_declaration_p): Don't emit any declarations from
Expand Down
12 changes: 8 additions & 4 deletions gcc/d/d-ctype.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,14 @@ TypeFunction::toCtype (void)
if (varargs != 1)
type_list = chainon (type_list, void_list_node);

ret_type = next ? next->toCtype() : void_type_node;

if (isref)
ret_type = build_reference_type (ret_type);
if (next != NULL)
{
ret_type = next->toCtype();
if (this->isref)
ret_type = build_reference_type (ret_type);
}
else
ret_type = void_type_node;

// Function type could be referenced by parameters, so set ctype earlier?
ctype = build_function_type (ret_type, type_list);
Expand Down

0 comments on commit 5434139

Please sign in to comment.