OpDecorate should not accept any number of literal operands.
authorDavid Neto <dneto@google.com>
Mon, 30 Nov 2015 19:39:31 +0000 (14:39 -0500)
committerDavid Neto <dneto@google.com>
Tue, 1 Dec 2015 20:38:32 +0000 (15:38 -0500)
commit39fa148234b3ec0d3561fe653ac5b59c5044c70a
tree928d5ade0e356338b6894c8735892a17b3c83cd8
parent36909c05a5248a28029ad1d04e80fe059cee237b
OpDecorate should not accept any number of literal operands.

This is a grammar fix.  The Decoration operand of OpDecorate (and
OpMemberDecorate) determines the remaining operands.  Don't just
allow any number of literal numbers as operands.

(The OperandVariableLiterals operand class as the last member
of the OpDecorate and OpMemberDecorate entries in in opcode.inc is
an artifact of how the spec generates the opcode descriptions. It's
not suitable for parsing those instructions.)

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/34
source/opcode.cpp
test/BinaryParse.cpp
test/TextToBinary.Annotation.cpp