api: add textlock check

This commit is contained in:
notomo
2020-11-23 15:53:24 +09:00
parent 82100a6bdb
commit 356319f356
6 changed files with 32 additions and 0 deletions

View File

@@ -260,6 +260,13 @@ for i = 1, #functions do
args[#args + 1] = converted
end
if fn.check_textlock then
output:write('\n if (textlock != 0) {')
output:write('\n api_set_error(error, kErrorTypeException, "%s", e_secure);')
output:write('\n goto cleanup;')
output:write('\n }\n')
end
-- function call
local call_args = table.concat(args, ', ')
output:write('\n ')
@@ -393,6 +400,16 @@ local function process_function(fn)
}
]], fn.name))
end
if fn.check_textlock then
write_shifted_output(output, [[
if (textlock != 0) {
api_set_error(&err, kErrorTypeException, "%s", e_secure);
goto exit_0;
}
]])
end
local cparams = ''
local free_code = {}
for j = #fn.parameters,1,-1 do