Skip to content

Commit

Permalink
Fix issue #230
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Nov 5, 2023
1 parent 9c72e4e commit decf713
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/errorhandling.nelua
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ function cgenerator.visitors.Call(context, node, emitter, ...)
emitter:add_value(deferemitter)
emitter:add_indent_ln('nelua_error_status = true;')
end
if #funcsym.type.rettypes > 0 then
if #funcsym.type.rettypes > 1 then
local rettypename = context:funcrettypename(funcsym.type)
emitter:add_indent_ln('return (',rettypename,'){0};')
elseif #funcsym.type.rettypes == 1 then
local rettypename = context:funcrettypename(funcsym.type)
emitter:add_indent('return ')
emitter:add_zeroed_type_literal(funcsym.type.rettypes[1], true)
emitter:add_ln(';')
else
emitter:add_indent_ln('return;')
end
Expand Down

0 comments on commit decf713

Please sign in to comment.