1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/unittests
Benoit Belley 2452e8e7fe [Support] PR33388 - Fix formatv_object move constructor
formatv_object currently uses the implicitly defined move constructor,
but it is buggy. In typical use-cases, the problem doesn't show-up
because all calls to the move constructor are elided. Thus, the buggy
constructors are never invoked.

The issue especially shows-up when code is compiled using the
-fno-elide-constructors compiler flag. For instance, this is useful when
attempting to collect accurate code coverage statistics.

The exact issue is the following:

The Parameters data member is correctly moved, thus making the
parameters occupy a new memory location in the target
object. Unfortunately, the default copying of the Adapters blindly
copies the vector of pointers, leaving each of these pointers
referencing the parameters in the original object instead of the copied
one. These pointers quickly become dangling when the original object is
deleted. This quickly leads to crashes.

The solution is to update the Adapters pointers when performing a move.
The copy constructor isn't useful for format objects and can thus be
deleted.

This resolves PR33388.

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

llvm-svn: 310475
2017-08-09 13:47:01 +00:00
..
ADT [ADT] Fix another "oops" spotted by eddyb and reported in IRC. 2017-07-10 05:41:14 +00:00
Analysis [LCG] Switch one of the update methods for the LazyCallGraph to support 2017-08-09 09:05:27 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
BinaryFormat Revert "Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""" 2017-07-08 03:06:10 +00:00
Bitcode Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
CodeGen [GlobalISel] Make GlobalISel a non-optional library. 2017-08-03 21:52:25 +00:00
DebugInfo [PDB] Fix linking of function symbols and local variables. 2017-08-08 18:34:44 +00:00
ExecutionEngine Delete Default and JITDefault code models 2017-08-03 02:16:21 +00:00
IR [unittest] Remove TODO comment which caused concern 2017-08-03 04:17:58 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
MC Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MI Delete Default and JITDefault code models 2017-08-03 02:16:21 +00:00
Object Fix unittest for buildbot with mips host (32bit big endian) from r295174 2017-02-15 16:03:22 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option [GSoC] Flag value completion for clang 2017-06-20 16:31:31 +00:00
ProfileData [Coverage] Add an API to retrive all instantiations of a function (NFC) 2017-08-02 23:35:25 +00:00
Support [Support] PR33388 - Fix formatv_object move constructor 2017-08-09 13:47:01 +00:00
Target Delete Default and JITDefault code models 2017-08-03 02:16:21 +00:00
Transforms [Cloning] Move distinct GlobalVariable debug info metadata in CloneModule 2017-08-03 09:23:03 +00:00
XRay [XRay][graph] Disambiguate name of type from member name 2017-02-10 06:59:25 +00:00
CMakeLists.txt Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00