Files
llvm-project/llvm/lib/Transforms/Utils/ProfileVerify.cpp
Nick Sarnie 5ea5b9eb8e [profcheck] Fix assert in getInitializer call on global with no initializer (#193514)
This code calls `getInitializer` without checking if the global has an
initializer, which causes an assert if there isn't one. These globals
may have no initializer after optimization from `globalopt`.

Check for an initializer first.

This is already locked down with
`CodeGen/SPIRV/legalize-zero-size-arrays-appending.ll` so we don't need
a new test.

This issue was exposed by
https://github.com/llvm/llvm-project/pull/192730.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-04-22 16:52:25 +00:00

10 KiB