<div dir="ltr">Hi Shafik,<div><br></div><div>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.</div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Kazu Hirata</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 6, 2021 at 1:24 PM Shafik Yaghmour <<a href="mailto:syaghmour@apple.com">syaghmour@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am wondering if you also need to check if token != LLDB_INVALID_ADDRESS<br>
<br>
> On Dec 4, 2021, at 6:34 PM, Kazu Hirata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br>
> <br>
> <br>
> Author: Kazu Hirata<br>
> Date: 2021-12-04T18:34:29-08:00<br>
> New Revision: ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a<br>
> <br>
> URL: <a href="https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a</a><br>
> DIFF: <a href="https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/ee4b462693b1ffeccfe1b8fcf0a0c12896ac6e6a.diff</a><br>
> <br>
> LOG: [lldb] Fix a warning<br>
> <br>
> This patch fixes:<br>
> <br>
>  lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp:386:13:<br>
>  error: comparison between NULL and non-pointer ('lldb::addr_t' (aka<br>
>  'unsigned long') and NULL) [-Werror,-Wnull-arithmetic]<br>
> <br>
> Added: <br>
> <br>
> <br>
> Modified: <br>
>    lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp<br>
> <br>
> Removed: <br>
> <br>
> <br>
> <br>
> ################################################################################<br>
> diff  --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp<br>
> index 0e25e9a8199bd..d41d422576a9f 100644<br>
> --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp<br>
> +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp<br>
> @@ -383,7 +383,7 @@ uint32_t PlatformWindows::DoLoadImage(Process *process,<br>
>     return LLDB_INVALID_IMAGE_TOKEN;<br>
>   }<br>
> <br>
> -  if (token == NULL) {<br>
> +  if (!token) {<br>
>     // XXX(compnerd) should we use the compiler to get the sizeof(unsigned)?<br>
>     uint64_t error_code =<br>
>         process->ReadUnsignedIntegerFromMemory(injected_result + 2 * word_size + sizeof(unsigned),<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
<br>
</blockquote></div>