mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-01 19:05:20 +08:00
44e32fe123
These tests: - InitializationState.InitializationState - InitializationStateDcheckDeathTest.Destroyed_NotUninitialized - InitializationStateDcheckDeathTest.Destroyed_NotValid rely on certain behavior from destroyed objects. This is undefined behavior and we know it, but the whole point of the of InitializationState and InitializationStateDcheck destructors is to try to help catch other parts of the program making use of undefined behavior. To make it impossible for the memory that formerly hosted these objects to be repurposed during tests after the objects are destroyed, these tests that attempt to work with destroyed objects are changed to use placement new, so that the lifetimes of the objects can be decoupled from the lifetimes of the buffers. Test: crashpad_util_test InitializationState* Change-Id: Ie972a54116c8b90a21a502d3ba13623583dfac06 Reviewed-on: https://chromium-review.googlesource.com/486383 Reviewed-by: Joshua Peraza <jperaza@chromium.org>