hanchenye-llvm-project/llvm/unittests
Pavel Labath d7e12574c6 YAMLIO: Fix serialization of strings with embedded nuls
Summary:
A bug/typo in Output::scalarString caused us to round-trip a StringRef
through a const char *. This meant that any strings with embedded nuls
were unintentionally cut short at the first such character. (It also
could have caused accidental buffer overruns, but it seems that all
StringRefs coming into this functions were formed from null-terminated
strings.)

This patch fixes the bug and adds an appropriate test.

Reviewers: sammccall, jhenderson

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60505

llvm-svn: 358176
2019-04-11 14:57:34 +00:00
..
ADT [MC] Fix floating-point literal lexing. 2019-03-28 21:12:28 +00:00
Analysis An unreachable block may have a route to a reachable block, don't fast-path return that it can't. 2019-04-04 23:09:40 +00:00
AsmParser Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BinaryFormat [MsgPack] Removed MsgPackTypes 2019-03-13 18:56:33 +00:00
Bitcode Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
CodeGen GlobalISel: Add another overload of buildUnmerge 2019-04-05 14:03:07 +00:00
DebugInfo [codeview] Remove Type member from CVRecord 2019-04-04 00:28:48 +00:00
Demangle Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ExecutionEngine [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
FuzzMutate Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IR [ConstantRange] Add signed/unsigned unionWith() 2019-04-07 20:20:24 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
MC Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef() 2019-04-07 03:58:42 +00:00
MI MachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC 2018-11-05 23:49:13 +00:00
Object Object/Minidump: Add support for reading the ModuleList stream 2019-04-08 09:57:29 +00:00
ObjectYAML Minidump: Add support for reading/writing strings 2019-04-05 08:06:26 +00:00
Option Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Passes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProfileData [SampleFDO] add suffix elision control for fcn names 2019-03-14 13:56:49 +00:00
Remarks Reland "[Remarks] Add a new Remark / RemarkParser abstraction" 2019-03-19 21:11:07 +00:00
Support YAMLIO: Fix serialization of strings with embedded nuls 2019-04-11 14:57:34 +00:00
Target [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
TextAPI [TextAPI] Prefix all architecture enums to fix the build on i386. 2019-04-04 22:56:50 +00:00
Transforms [DebugInfo] Introduce DW_OP_LLVM_convert 2019-03-19 13:16:28 +00:00
XRay Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
tools [X86] Merge the different CMOV instructions for each condition code into single instructions that store the condition code as an immediate. 2019-04-05 19:27:41 +00:00
CMakeLists.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00
unittest.cfg.in