MCPcopy Create free account
hub / github.com/WebAssembly/wabt / ReportUnexpectedOpcode

Method ReportUnexpectedOpcode

src/binary-reader.cc:257–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257Result 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
277Result BinaryReader::ReadOpcode(Opcode* out_value, const char* desc) {
278 uint8_t value = 0;

Callers

nothing calls this directly

Calls 3

StringPrintfFunction · 0.85
GetBytesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected