diff options
| author | Dustin Graves <dustin@lunarg.com> | 2016-03-08 14:42:59 -0700 |
|---|---|---|
| committer | Dustin Graves <dustin@lunarg.com> | 2016-03-08 17:08:02 -0700 |
| commit | 9e313368449e99458a020ed489e295b89f7cf75a (patch) | |
| tree | bc61dd5597818f8513d5c4ade59eab50274a90d7 /generator.py | |
| parent | 1e93718c913bf35a86ad744a4845cb822635e096 (diff) | |
| download | usermoji-9e313368449e99458a020ed489e295b89f7cf75a.tar.xz | |
layers: Add string array parameter checking
The param_checker layer had previously peformed a NULL
check on the pointer to a string array, but had not
performed a NULL check for the individual strings in the
array. This adds NULL checks for the individual strings.
Change-Id: Id4527f670086187e8cd1f146027bfdfd1e134b7b
Diffstat (limited to 'generator.py')
| -rw-r--r-- | generator.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generator.py b/generator.py index 5dc3c9a8..efb46fbc 100644 --- a/generator.py +++ b/generator.py @@ -3134,7 +3134,8 @@ class ParamCheckerOutputGenerator(OutputGenerator): # If count and array parameters are optional, there # will be no validation if req == 'VK_TRUE' or cvReq == 'VK_TRUE': - checkExpr = 'skipCall |= validate_array(report_data, {}, "{ln}", {dn}, {pf}{ln}, {pf}{vn}, {}, {});\n'.format(name, cvReq, req, ln=lenParam.name, dn=valueDisplayName, vn=value.name, pf=valuePrefix) + funcName = 'validate_array' if value.type != 'char' else 'validate_string_array' + checkExpr = 'skipCall |= {}(report_data, {}, "{ln}", {dn}, {pf}{ln}, {pf}{vn}, {}, {});\n'.format(funcName, name, cvReq, req, ln=lenParam.name, dn=valueDisplayName, vn=value.name, pf=valuePrefix) elif not value.isoptional: # Function pointers need a reinterpret_cast to void* if value.type[:4] == 'PFN_': |
