| 255 | } |
| 256 | |
| 257 | Result BinaryReader::ReportUnexpectedOpcode(Opcode opcode, const char* where) { |
| 258 | std::string message = "unexpected opcode"; |
| 259 | if (where) { |
| 260 | message += ' '; |
| 261 | message += where; |
| 262 | } |
| 263 | |
| 264 | message += ":"; |
| 265 | |
| 266 | std::vector<uint8_t> bytes = opcode.GetBytes(); |
| 267 | assert(bytes.size() > 0); |
| 268 | |
| 269 | for (uint8_t byte : bytes) { |
| 270 | message += StringPrintf(" 0x%x", byte); |
| 271 | } |
| 272 | |
| 273 | PrintError("%s", message.c_str()); |
| 274 | return Result::Error; |
| 275 | } |
| 276 | |
| 277 | Result BinaryReader::ReadOpcode(Opcode* out_value, const char* desc) { |
| 278 | uint8_t value = 0; |
nothing calls this directly
no test coverage detected