[llvm] 870f691 - Fix "pointer is null" static analyzer warnings. NFCI.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 10:43:34 PDT 2020


On Fri, Mar 27, 2020 at 3:23 AM Simon Pilgrim <llvm-dev at redking.me.uk>
wrote:

> Yes it was a clang static analyzer report listed on
> https://llvm.org/reports/scan-build/
>
> I'd include the specific link in the commit message but they don't persist
> very long.
>
No worries - clearly I was a bit late reviewing these, so the links
probably would've been dead. Maybe copy/pasting the diagnostics into the
commit message might be handy, though?

> BTW - I keep missing your feedback emails as they get lost in the firehose
> that is llvm-commits - could you use phabricator instead to discuss
> particular commits please?
>
I know llvm-commits is a bit of a busy place (hence why it's taken me 3
months to get around to reviewing some things... ) - but even if I send you
feedback that way, other people might not, so it seems important to have
you mail setup so such messages don't get lost (using gmail I have anything
where I am on the "to" line sent to my inbox and starred separately, for
instance). People might be reporting urgent things this way - like
post-commit breakages and other discussions & they can come from a variety
of people who won't all be using Phabricator to provide that feedback.

- Dave

> Cheers, Simon.
> On 27/03/2020 01:36, David Blaikie wrote:
>
> Was this for the Clang Static Analyzer? Any idea what parts the analyzer
> couldn't understand?
>
> I assume it has to assume that function returns might already be non-null
> (eg: T1B probably isn't "might be null" & dereferencing it wouldn't be a
> problem? Or is any pointer return "Maybe null" in which case maybe just
> asserting T1B and T2B are non-null as soon as they're returned might be
> more suitable/closer to the source of the divergence?)
>
> On Fri, Jan 10, 2020 at 3:11 AM Simon Pilgrim via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>> Author: Simon Pilgrim
>> Date: 2020-01-10T11:10:42Z
>> New Revision: 870f6917936fdb8050be3ca3c67d9259390c4326
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326.diff
>>
>> LOG: Fix "pointer is null" static analyzer warnings. NFCI.
>>
>> Assert that the pointers are non-null before dereferencing them.
>>
>> Added:
>>
>>
>> Modified:
>>     llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
>> b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
>> index b18730d967a3..d0285a7aa377 100644
>> --- a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
>> +++ b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
>> @@ -282,6 +282,7 @@ bool
>> HexagonEarlyIfConversion::matchFlowPattern(MachineBasicBlock *B,
>>    // can fall through into the other, in other words, it will be executed
>>    // in both cases. We only want to predicate the block that is executed
>>    // conditionally.
>> +  assert(TB && FB && "Failed to find triangle control flow blocks");
>>    unsigned TNP = TB->pred_size(), FNP = FB->pred_size();
>>    unsigned TNS = TB->succ_size(), FNS = FB->succ_size();
>>
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200327/81830c1e/attachment-0001.html>


More information about the llvm-commits mailing list