We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8374e98 commit 339f5e9Copy full SHA for 339f5e9
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