mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add standard argument checks as part of translator code generation.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@219 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -39,6 +39,17 @@ def make_cpptoc_impl_new(name, func, defined_names):
|
||||
|
||||
result += '\n // END DELETE BEFORE MODIFYING'
|
||||
|
||||
# NULL check all pointer arguments.
|
||||
if len(parts['args']) > 0:
|
||||
check = [];
|
||||
for arg in parts['args']:
|
||||
if arg.find('*') >= 0:
|
||||
argname = string.split(arg)[-1];
|
||||
result += '\n DCHECK('+argname+');'
|
||||
check.append('!'+argname);
|
||||
result += '\n if ('+string.join(check,' || ')+')'
|
||||
result += '\n return;'
|
||||
|
||||
result += '\n}\n\n'
|
||||
return result
|
||||
|
||||
|
Reference in New Issue
Block a user