[Openmp-commits] [PATCH] D90962: [OpenMP] Fix possible NULL dereferences

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 6 12:15:42 PST 2020


jdoerfert added a comment.

In D90962#2379710 <https://reviews.llvm.org/D90962#2379710>, @AndreyChurbanov wrote:

> In D90962#2379674 <https://reviews.llvm.org/D90962#2379674>, @jdoerfert wrote:
>
>> So, we had asserts, right? And this code is "copied" a few times all over. What I try to say is, I'm not sure this is a "fix" and it is sufficient.
>
> KMP_DEBUG_ASSERT is no-op in release build. Thus this patch adds missed checks in order to make static code analyzers happy.
> In real codes we haven't encountered broken source location string, but in theory this might happen and then NULL pointer could be dereferenced.

I don't think we should generally "make the static code analyzers happy" by swapping out reasonable asserts with some if-then-else logic for a case we don't expect to happen.
It also doesn't help us in any of the other copies of this code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90962/new/

https://reviews.llvm.org/D90962



More information about the Openmp-commits mailing list