angle: fix potential nullptr dereference

`checkIsScalarBool` immediately deref's `typedCond`, which may be NULL.
Prevent that.

Caught by the static analyzer:
>
device/generic/vulkan-cereal/third-party/angle/src/compiler/translator/ParseContext.cpp:893:9:
warning: Called C++ object pointer is null
[clang-analyzer-core.CallAndMessage]

Bug: b/206470603
Test: None
Change-Id: I2c055d637fb3ef254c0cebfae32bfbe17bf850ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3935460
Auto-Submit: Greg Schlomoff <gregschlom@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
George Burgess IV 2022-05-23 13:05:46 -07:00 коммит произвёл Angle LUCI CQ
Родитель 85631d24dd
Коммит 54d094fe1d
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2671,7 +2671,7 @@ TIntermNode *TParseContext::addLoop(TLoopType type,
}
if (cond == nullptr || typedCond)
{
if (type == ELoopDoWhile)
if (type == ELoopDoWhile && typedCond)
{
checkIsScalarBool(line, typedCond);
}