File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2738,9 +2738,11 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
2738
2738
llvm::StructType* array_type = static_cast <llvm::StructType*>(
2739
2739
llvm_utils->get_type_from_ttype_t_util (x.m_type , module .get ()));
2740
2740
llvm::Constant *ptr = module ->getOrInsertGlobal (x.m_name , array_type);
2741
- module ->getNamedGlobal (x.m_name )->setInitializer (
2742
- llvm::ConstantStruct::get (array_type,
2743
- llvm::Constant::getNullValue (array_type)));
2741
+ if (!external) {
2742
+ module ->getNamedGlobal (x.m_name )->setInitializer (
2743
+ llvm::ConstantStruct::get (array_type,
2744
+ llvm::Constant::getNullValue (array_type)));
2745
+ }
2744
2746
llvm_symtab[h] = ptr;
2745
2747
} else if (x.m_type ->type == ASR::ttypeType::Logical) {
2746
2748
llvm::Constant *ptr = module ->getOrInsertGlobal (x.m_name ,
You can’t perform that action at this time.
0 commit comments