forked from OSchip/llvm-project
Make sure to flush the stream to make sure the string is up to date when we query its size.
llvm-svn: 247175
This commit is contained in:
parent
66dcafc3d6
commit
aa61a1563b
|
@ -557,6 +557,7 @@ DisassemblerLLVMC::LLVMCDisassembler::PrintMCInst (llvm::MCInst &mc_inst,
|
|||
llvm::raw_svector_ostream inst_stream(inst_string);
|
||||
m_instr_printer_ap->printInst (&mc_inst, inst_stream, unused_annotations,
|
||||
*m_subtarget_info_ap);
|
||||
inst_stream.flush();
|
||||
const size_t output_size = std::min(dst_len - 1, inst_string.size());
|
||||
std::memcpy(dst, inst_string.data(), output_size);
|
||||
dst[output_size] = '\0';
|
||||
|
|
Loading…
Reference in New Issue