diff --git a/compiler/llvm/agllvm.pas b/compiler/llvm/agllvm.pas index 6c7051a2ca..d64b03d8ce 100644 --- a/compiler/llvm/agllvm.pas +++ b/compiler/llvm/agllvm.pas @@ -399,7 +399,10 @@ implementation if o.ref^.refaddr=addr_full then begin getopstr:=''; - getopstr:=LlvmAsmSymName(o.ref^.symbol); + if assigned(o.ref^.symbol) then + getopstr:=LlvmAsmSymName(o.ref^.symbol) + else + getopstr:='null'; if o.ref^.offset<>0 then internalerror(2013060223); end @@ -437,12 +440,15 @@ implementation end; top_tai: begin - tmpinline:=1; - tmpasmblock:=false; - hp:=o.ai; - owner.writer.AsmWrite(fstr); - fstr:=''; - owner.WriteTai(false,false,tmpinline,tmpasmblock,hp); + if assigned(o.ai) then + begin + tmpinline:=1; + tmpasmblock:=false; + hp:=o.ai; + owner.writer.AsmWrite(fstr); + fstr:=''; + owner.WriteTai(false,false,tmpinline,tmpasmblock,hp); + end; result:=''; end; {$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)} diff --git a/compiler/llvm/llvmtype.pas b/compiler/llvm/llvmtype.pas index c16a18e29f..37d4ccca91 100644 --- a/compiler/llvm/llvmtype.pas +++ b/compiler/llvm/llvmtype.pas @@ -217,6 +217,8 @@ implementation var value: tai_abstracttypedconst; begin + if not assigned(p) then + exit; case p.typ of ait_llvmalias: begin @@ -388,6 +390,8 @@ implementation procedure TLLVMTypeInfo.insert_tai_typeconversions(toplevellist: tasmlist; p: tai); begin + if not assigned(p) then + exit; case p.typ of ait_llvmins: insert_llvmins_typeconversions(toplevellist,taillvm(p));