Validation for struct nesting depth.
authorEhsan Nasiri <ehsann@google.com>
Sun, 4 Dec 2016 15:48:26 +0000 (10:48 -0500)
committerDavid Neto <dneto@google.com>
Wed, 7 Dec 2016 21:15:56 +0000 (16:15 -0500)
commit4fb79b54f28791292d7bab029d13cf5f89da5106
tree867d08041c9d91f4277766bb283fdd18c2db7964
parentd5b0cd34c95a5dca4af8e83560af25cc581e8034
Validation for struct nesting depth.

According to sectin 2.17 in SPIR-V Spec, the structure nesting depth may
not be larger than 255. This is interpreted as structures nested in
structures. The code does not look into arrays or follow pointers to see
if it reaches a structure downstream.

Use memoization to avoid exponential runtime.
source/val/validation_state.cpp
source/val/validation_state.h
source/validate_instruction.cpp
test/val/val_limits_test.cpp