[Lldb-commits] [lldb] ee4b462 - [lldb] Fix a warning

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 6 13:51:40 PST 2021


Hi Shafik,

Let's loop in Saleem here, the author
of f1585a4b47cc9c08c9a4c10058597f4b7468c227.  Do we need to worry about a
case where ReadPointerFromMemory, called at PlatformWindows.cpp:379,
returns LLDB_INVALID_ADDRESS without setting status to Fail?  I am guessing
that could theoretically happen if scalar.ULongLong fails
inside ReadScalarIntegerFromMemory, which is called
from ReadPointerFromMemory.

Thanks in advance,

Kazu Hirata

On Mon, Dec 6, 2021 at 1:24 PM Shafik Yaghmour <syaghmour at apple.com> wrote:

> I am wondering if you also need to check if token != LLDB_INVALID_ADDRESS
>
> > On Dec 4, 2021, at 6:34 PM, Kazu Hirata via lldb-commits <
> lldb-commits at lists.llvm.org> wrote:
> >
> >
> > Author: Kazu Hirata
> > Date: 2021-12-04T18:34:29-08:00
> > New Revision: ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a
> >
> > URL:
> https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a
> > DIFF:
> https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a.diff
> >
> > LOG: [lldb] Fix a warning
> >
> > This patch fixes:
> >
> >  lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp:386:13:
> >  error: comparison between NULL and non-pointer ('lldb::addr_t' (aka
> >  'unsigned long') and NULL) [-Werror,-Wnull-arithmetic]
> >
> > Added:
> >
> >
> > Modified:
> >    lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
> >
> > Removed:
> >
> >
> >
> >
> ################################################################################
> > diff  --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
> b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
> > index 0e25e9a8199bd..d41d422576a9f 100644
> > --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
> > +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
> > @@ -383,7 +383,7 @@ uint32_t PlatformWindows::DoLoadImage(Process
> *process,
> >     return LLDB_INVALID_IMAGE_TOKEN;
> >   }
> >
> > -  if (token == NULL) {
> > +  if (!token) {
> >     // XXX(compnerd) should we use the compiler to get the
> sizeof(unsigned)?
> >     uint64_t error_code =
> >         process->ReadUnsignedIntegerFromMemory(injected_result + 2 *
> word_size + sizeof(unsigned),
> >
> >
> >
> > _______________________________________________
> > lldb-commits mailing list
> > lldb-commits at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211206/d47cb6ab/attachment.html>


More information about the lldb-commits mailing list