Eliminate parameter-order check from ID-validation.

This commit is contained in:
Dejan Mircevski 2016-02-03 12:34:52 -05:00
parent 10fa696af7
commit 4038195d81
2 changed files with 0 additions and 20 deletions

View File

@ -964,12 +964,6 @@ bool idUsage::isValid<SpvOpFunctionParameter>(const spv_instruction_t* inst,
size_t paramIndex = 0;
assert(firstInst < inst && "Invalid instruction pointer");
while (firstInst != --inst) {
spvCheck(SpvOpFunction != inst->opcode &&
SpvOpFunctionParameter != inst->opcode &&
SpvOpLine != inst->opcode && SpvOpNoLine != inst->opcode,
DIAG(0) << "OpFunctionParameter is not preceded by OpFunction or "
"OpFunctionParameter sequence.";
return false);
if (SpvOpFunction == inst->opcode) {
break;
} else if (SpvOpFunctionParameter == inst->opcode) {

View File

@ -1064,20 +1064,6 @@ TEST_F(ValidateID, OpFunctionParameterResultTypeBad) {
OpFunctionEnd)";
CHECK(spirv, SPV_ERROR_INVALID_ID);
}
TEST_F(ValidateID, OpFunctionParameterOrderBad) {
const char* spirv = R"(
%1 = OpTypeVoid
%2 = OpTypeInt 32 0
%3 = OpTypeFunction %1 %2
%7 = OpTypePointer Function %2
%4 = OpFunction %1 None %3
%8 = OpVariable %7 Function
%5 = OpFunctionParameter %2
%6 = OpLabel
OpReturn
OpFunctionEnd)";
CHECK(spirv, SPV_ERROR_INVALID_ID);
}
TEST_F(ValidateID, OpFunctionCallGood) {
const char* spirv = R"(