Return nullptr after assert to avoid uninitialized variables
authorRyan Harrison <rharrison@google.com>
Wed, 28 Aug 2019 15:25:12 +0000 (11:25 -0400)
committerRyan Harrison <rharrison@google.com>
Wed, 28 Aug 2019 15:36:27 +0000 (11:36 -0400)
commit6d35ae89c0914de8088ce5a56741f9f575a3b93a
treed5b73a22fb7c9abd920ae3d91af81d3b37b9a6bb
parent14e13e757d974a65119b725b42c72a00ee029acc
Return nullptr after assert to avoid uninitialized variables

In the current version of the code on non-debug builds these cases
will fallthrough, since assert is a no-op, and eventually make a call
passing in |op| which hasn't been initialized. clang is currently
throwing a warning about this behaviour when integrating downstream.

This patch changes the behaviour, so that in any branch that has an
assert now has a return nullptr, to indicate failure after it and
avoid the uninitialized variable usage.
glslang/MachineIndependent/ParseHelper.cpp