Skip to content

Commit

Permalink
Use different temp. variable names for length variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neopallium committed May 25, 2013
1 parent de39438 commit fb8d72e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion native_objects/stages.lua
Expand Up @@ -600,7 +600,11 @@ c_call = function(self, rec, parent)
end
if var.wrap == '&' then
-- need a tmp variable to dereference parameter.
local temp_name = "${function_name}_" .. var.name .. "_tmp"
local var_name = var.name
if var.is_length_ref then
var_name = var.length
end
local temp_name = "${function_name}_" .. var_name .. "_tmp"
parent:add_record(ffi_source("ffi_temps")(
{' local ', temp_name, ' = ffi.new("',var.c_type,'[1]")\n'}))
if var.has_in or var._rec_type == 'var_in' then
Expand Down

0 comments on commit fb8d72e

Please sign in to comment.