Issues a diagnostic describing an exhaustion of input condition when trying to decode an instruction operand, and returns SPV_ERROR_INVALID_BINARY.
| 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); } |
nothing calls this directly
no test coverage detected