diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2022-12-08 17:53:54 -0800 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2022-12-08 17:53:54 -0800 |
commit | f9d8090a90a1f1f9ddf6aebb82e7fc4c1dbcf030 (patch) | |
tree | d768b6641e32469dca7e7b90c7486a82cd376bb4 /llvm/lib/Object/COFFObjectFile.cpp | |
parent | e89e8dcfad364d23515de25ac87d26dfe25badbb (diff) | |
download | llvm-f9d8090a90a1f1f9ddf6aebb82e7fc4c1dbcf030.zip llvm-f9d8090a90a1f1f9ddf6aebb82e7fc4c1dbcf030.tar.gz llvm-f9d8090a90a1f1f9ddf6aebb82e7fc4c1dbcf030.tar.bz2 |
Improve error handling for invalid breakpoint `-t` and `-x` options.
Breakpoint option `-t` checks that `option_arg` is empty by checking `option_arg[0] == '\0'`. This is unnecessary: the next two checks for comparing against "current" and calling `getAsInteger` already gracefully handle an empty StringRef. If the `option_arg` string is empty, this crashes (or triggers an assertion failure with asserts enabled). Also, this sets the thread id to `LLDB_INVALID_THREAD_ID` if the thread id is invalid -- it should just not set the thread id.
Likewise of `-x` which checks `option_arg[0] == '\n'` unnecessarily.
I believe both of these bugs are unreachable via normal LLDB usage, and are only accessible via the fuzzer -- most likely some other CLI parsing is trimming whitespace and rejecting empty inputs. Still, it doesn't hurt to simplify this bit.
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions