| 517 | } |
| 518 | |
| 519 | spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const { |
| 520 | if (!print_) { |
| 521 | size_t length = text_.str().size(); |
| 522 | char* str = new char[length + 1]; |
| 523 | if (!str) return SPV_ERROR_OUT_OF_MEMORY; |
| 524 | strncpy(str, text_.str().c_str(), length + 1); |
| 525 | spv_text text = new spv_text_t(); |
| 526 | if (!text) { |
| 527 | delete[] str; |
| 528 | return SPV_ERROR_OUT_OF_MEMORY; |
| 529 | } |
| 530 | text->str = str; |
| 531 | text->length = length; |
| 532 | *text_result = text; |
| 533 | } |
| 534 | return SPV_SUCCESS; |
| 535 | } |
| 536 | |
| 537 | spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian, |
| 538 | uint32_t /* magic */, uint32_t version, |
no test coverage detected