diff options
author | Dimitry Andric <dimitry@andric.com> | 2019-10-10 20:26:59 +0000 |
---|---|---|
committer | Dimitry Andric <dimitry@andric.com> | 2019-10-10 20:26:59 +0000 |
commit | 6722cdc9f3b9b60180f09f6ad7bb7be07dec36fa (patch) | |
tree | ab4e924b4a3fe40e24dd02981123eb0d2f894a3c /source/Core/UserSettingsController.cpp | |
parent | e96750b15db65d056d4257f1c74c2c6320bae51b (diff) | |
download | lldb-6722cdc9f3b9b60180f09f6ad7bb7be07dec36fa.tar.gz |
Fix process launch failure on FreeBSD after r365761
Summary:
After rLLDB365761, and with `LLVM_ENABLE_ABI_BREAKING_CHECKS` enabled,
launching any process on FreeBSD crashes lldb with:
```
Expected<T> must be checked before access or destruction.
Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed).
```
This is because `m_operation_thread` and `m_monitor_thread` were wrapped
in `llvm::Expected<>`, but this requires the objects to be correctly
initialized before accessing them.
To fix the crashes, use `llvm::Optional<>` for the members (as indicated
by labath), and use local variables to store the return values of
`LaunchThread` and `StartMonitoringChildProcess`. Then, only assign to
the member variables after checking if the return values indicated
success.
Reviewers: devnexen, emaste, MaskRay, mgorny
Reviewed By: devnexen
Subscribers: jfb, labath, krytarowski, lldb-commits
Differential Revision: https://reviews.llvm.org/D68723
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@374444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Core/UserSettingsController.cpp')
0 files changed, 0 insertions, 0 deletions