We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d78949 commit 8ef5d30Copy full SHA for 8ef5d30
src/core/Program.cpp
@@ -192,9 +192,11 @@ void Program::allocateProgramScopeVars()
192
itr++)
193
{
194
auto var = llvm::cast<llvm::GlobalVariable>(itr->first);
195
- const llvm::Constant* initializer = var->getInitializer();
196
- if (!initializer)
+ if (!var->hasInitializer())
+ {
197
continue;
198
+ }
199
+ const llvm::Constant* initializer = var->getInitializer();
200
201
size_t varptr = itr->second.getPointer();
202
if (initializer->getType()->getTypeID() == llvm::Type::PointerTyID)
0 commit comments