MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / exhaustedInputDiagnostic

Method exhaustedInputDiagnostic

source/binary.cpp:167–176  ·  view source on GitHub ↗

Issues a diagnostic describing an exhaustion of input condition when trying to decode an instruction operand, and returns SPV_ERROR_INVALID_BINARY.

Source from the content-addressed store, hash-verified

165 // trying to decode an instruction operand, and returns
166 // SPV_ERROR_INVALID_BINARY.
167 spv_result_t exhaustedInputDiagnostic(size_t inst_offset, spv::Op opcode,
168 spv_operand_type_t type) {
169 return diagnostic() << "End of input reached while decoding Op"
170 << spvOpcodeString(opcode) << " starting at word "
171 << inst_offset
172 << ((_.word_index < _.num_words) ? ": truncated "
173 : ": missing ")
174 << spvOperandTypeStr(type) << " operand at word offset "
175 << _.word_index - inst_offset << ".";
176 }
177
178 // Returns the endian-corrected word at the current position.
179 uint32_t peek() const { return peekAt(_.word_index); }

Callers

nothing calls this directly

Calls 2

spvOpcodeStringFunction · 0.85
spvOperandTypeStrFunction · 0.85

Tested by

no test coverage detected