diff options
| author | Pete Lawrence <plawrence@apple.com> | 2023-12-12 02:50:18 -1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 09:50:18 -0300 |
| commit | 0e9879ed9711ac280c5e1ea47f77a033393d6baa (patch) | |
| tree | 9fd50f17b8aa7bd8213a018b61e4ba3dd27b2c88 /llvm/lib/Transforms/Utils/Local.cpp | |
| parent | 97181bf9a05251d48c8016ad61d3e38df90620bb (diff) | |
| download | llvm-0e9879ed9711ac280c5e1ea47f77a033393d6baa.zip llvm-0e9879ed9711ac280c5e1ea47f77a033393d6baa.tar.gz llvm-0e9879ed9711ac280c5e1ea47f77a033393d6baa.tar.bz2 | |
[lldb] Correctly check and report error states in StackFrame.cpp (#74414)
This commits fixes a few subtle bugs where the method:
1. Declares a local `Status error` which eclipses the method's parameter
`Status &error`.
- The method then sets the error state to the local `error` and returns
without ever touching the parameter `&error`.
- This effectively traps the error state and its message from ever
reaching the caller.
- I also threw in a null pointer check in case the callee doesn't set
its `Status` parameter but returns `0`/`nullptr`.
2. Declares a local `Status deref_error` (good), passes it to the
`Dereference` method (also good), but then checks the status of the
method's `Status &error` parameter (not good).
- The fix checks `deref_error` instead and also checks for a `nullptr`
return value.
- There's a good opportunity here for a future PR that changes the
`Dereference` method to fold an error state into the `ValueObject`
return value's `m_error` instead of using a parameter.
3. Declares another local `Status error`, which it doesn't pass to a
method (because there isn't a parameter for it), and then checks for an
error condition that never happens.
- The fix just checks the callee's return value, because that's all it
has to go on.
- This likely comes from a copy/paste from issue 1 above.
rdar://119155810
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
0 files changed, 0 insertions, 0 deletions
