https://github.com/mikerice1969 created
https://github.com/llvm/llvm-project/pull/85473
The value of SubExpr is not null since getSubExpr would assert in that case.
Remove the nullptr check. This avoids confusion since SubExpr is used without
check later in the function.
>From 56c3ca2e2cfac7b
llvmbot wrote:
@llvm/pr-subscribers-clang-tidy
Author: Mike Rice (mikerice1969)
Changes
The value of SubExpr is not null since getSubExpr would assert in that case.
Remove the nullptr check. This avoids confusion since SubExpr is used without
check later in the function.
---
Full diff:
https://github.com/PiotrZSL approved this pull request.
First this null-ptr check does nothing because in line 114 we still missing
nullptr check.
Proper way would be to "return" when we find nullptr were it shoudnt.
Second thing, asserts mean nothing. In release mode they are disabled. This
m
carlosgalvezp wrote:
Shouldn't we simply `return`?
As you say, the assert is disabled in Release mode. Even if it's enabled, the
author if `getSubExpr` may one day decide to remove the assert without possibly
knowing all the places that do rely on that assert, leaving the code
unprotected. It
https://github.com/mikerice1969 closed
https://github.com/llvm/llvm-project/pull/85473
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mikerice1969 wrote:
I mentioned the assert just to make the point that setSubExpr is written so it
doesn't return a nullptr. So it is not expected and the deference is ok.
I went ahead with this change but feel free to update if you like. But adding a
return when nullptr is seen here would co