<< inst->words[decorationGroupIndex]
<< "' is not a decoration group.";
return false);
- for (uint64_t targetIndex = 2; targetIndex < inst->words.size(); ++targetIndex) {
+ for (size_t targetIndex = 2; targetIndex < inst->words.size(); ++targetIndex) {
auto target = find(inst->words[targetIndex]);
spvCheck(!found(target), DIAG(targetIndex)
<< "OpGroupDecorate Target <id> '"
template <>
bool idUsage::isValid<OpTypeStruct>(const spv_instruction_t *inst,
const spv_opcode_desc) {
- for (uint64_t memberTypeIndex = 2; memberTypeIndex < inst->words.size();
+ for (size_t memberTypeIndex = 2; memberTypeIndex < inst->words.size();
++memberTypeIndex) {
auto memberType = find(inst->words[memberTypeIndex]);
spvCheck(!found(memberType), DIAG(memberTypeIndex)
<< inst->words[returnTypeIndex]
<< "' is not a type.";
return false);
- for (uint64_t paramTypeIndex = 3; paramTypeIndex < inst->words.size();
+ for (size_t paramTypeIndex = 3; paramTypeIndex < inst->words.size();
++paramTypeIndex) {
auto paramType = find(inst->words[paramTypeIndex]);
spvCheck(!found(paramType), DIAG(paramTypeIndex)
return false);
auto componentType = find(resultType->second.inst->words[2]);
spvCheck(!found(componentType), assert(0 && "Unreachable!"));
- for (uint64_t constituentIndex = 3; constituentIndex < inst->words.size();
+ for (size_t constituentIndex = 3; constituentIndex < inst->words.size();
constituentIndex++) {
auto constituent = find(inst->words[constituentIndex]);
spvCheck(!found(constituent), assert(0 && "Unreachable!"));
auto componentType = find(columnType->second.inst->words[2]);
spvCheck(!found(componentType), assert(0 && "Unreachable!"));
- for (uint64_t constituentIndex = 3; constituentIndex < inst->words.size();
+ for (size_t constituentIndex = 3; constituentIndex < inst->words.size();
constituentIndex++) {
auto constituent = find(inst->words[constituentIndex]);
spvCheck(!found(constituent),
"Result Type <id> '"
<< resultType->second.id << "'s array length.";
return false);
- for (uint64_t constituentIndex = 3; constituentIndex < inst->words.size();
+ for (size_t constituentIndex = 3; constituentIndex < inst->words.size();
constituentIndex++) {
auto constituent = find(inst->words[constituentIndex]);
spvCheck(!found(constituent),
return false);
} break;
case OpTypeStruct: {
- for (uint64_t elementIndex = 2;
+ for (size_t elementIndex = 2;
elementIndex < resultType->second.inst->words.size(); ++elementIndex) {
auto element = find(resultType->second.inst->words[elementIndex]);
spvCheck(!found(element), assert(0 && "Unreachable!"));
return false);
auto function = inst - 1;
// NOTE: Find OpFunction & ensure OpFunctionParameter is not out of place.
- uint64_t paramIndex = 0;
+ size_t paramIndex = 0;
while (firstInst != function) {
spvCheck(OpFunction != function->opcode &&
OpFunctionParameter != function->opcode,
<< "OpFunctionCall Function <id>'s parameter count does not match "
"the argument count.";
return false);
- for (uint64_t argumentIndex = 4, paramIndex = 3;
+ for (size_t argumentIndex = 4, paramIndex = 3;
argumentIndex < inst->words.size(); argumentIndex++, paramIndex++) {
auto argument = find(inst->words[argumentIndex]);
spvCheck(!found(argument), DIAG(argumentIndex)
"OpName %1 \"\n\n\nfoo\nbar\"\n", // multiple newlines
"OpName %1 \"\\\"foo\nbar\\\"\"\n", // escaped quote
"OpName %1 \"\\\\foo\nbar\\\\\"\n", // escaped backslash
- "OpName %1 \"\U00E4BAB2\"\n", // UTF-8
+ "OpName %1 \"xE4\xBA\xB2\"\n", // UTF-8
}));
// clang-format on
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
{"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f
{"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline
- {"OpName %1 \"\\\U00E4BAB2\"\n", "OpName %1 \"\U00E4BAB2\"\n"}, // Escape utf-8
+ {"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8
}));
// clang-format on
{R"("\\")", "\\"},
{"\"\\foo\nbar\"", "foo\nbar"},
{"\"\\foo\\\nbar\"", "foo\nbar"},
- {"\"\U00E4BAB2\"", "\U00E4BAB2"},
- {"\"\\\U00E4BAB2\"", "\U00E4BAB2"},
- {"\"this \\\" and this \\\\ and \\\U00E4BAB2\"",
- "this \" and this \\ and \U00E4BAB2"}
+ {"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
+ {"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
+ {"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"",
+ "this \" and this \\ and \xE4\xBA\xB2"}
}));
TEST(TextLiteral, StringTooLong) {