Skip to content

Commit

Permalink
Fix: missing PCD_RETURNVOID instruction for void functions
Browse files Browse the repository at this point in the history
  • Loading branch information
positively-charged committed Nov 13, 2016
1 parent a5ba2f2 commit 0149f67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/codegen/dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ void write_func( struct codegen* codegen, struct func* func ) {
alloc_param_indexes( &record, func->params );
alloc_funcscopevars_indexes( &record, &impl->funcscope_vars );
c_write_block( codegen, impl->body );
if ( func->return_spec == SPEC_VOID && ! func->ref ) {
c_pcd( codegen, PCD_RETURNVOID );
}
impl->size = record.size;
codegen->func = NULL;
if ( impl->nested_funcs ) {
Expand Down

0 comments on commit 0149f67

Please sign in to comment.