jasonmolenda wrote:

I don't think anyone will eagle eye enough to see it, but one change I made was 
in ObjectFileJSON where it used to do `auto text = 
toStringRef(extractor_sp->GetData()`.  `GetData()` returns an 
`ArrayRef<uint8_t>` of the DataExtractor's contiguous bytes starting at offset 
0.  The DataExtractor happened to have a 512 byte DataBufferSP that the ~200 
character JSON object file was in (in some test cases).  This is then passed to 
llvm's JSON parser, and one check it does is that at the end of a complete 
parse, it has reached the end of the StringRef.  But the StringRef was the full 
512 bytes of the DataBuffer, so it would return an error.

I instead changed this to `auto text = llvm::StringRef((const char 
*)extractor_sp->GetData().data());`, to only put the bytes up to the nul '\0' 
character into the StringRef. 

https://github.com/llvm/llvm-project/pull/178347
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to