浏览代码

* correctly handle empty ansistring constants for llvm

git-svn-id: branches/hlcgllvm@30127 -
Jonas Maebe 10 年之前
父节点
当前提交
eba3f534de
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      compiler/llvm/nllvmtcon.pas

+ 8 - 0
compiler/llvm/nllvmtcon.pas

@@ -253,6 +253,14 @@ implementation
       field: tfieldvarsym;
       field: tfieldvarsym;
       dataptrdef: tdef;
       dataptrdef: tdef;
     begin
     begin
+      { nil pointer? }
+      if not assigned(ll.lab) then
+        begin
+          if ll.ofs<>0 then
+            internalerror(2015030701);
+          inherited;
+          exit;
+        end;
       { if the returned offset is <> 0, then the string data
       { if the returned offset is <> 0, then the string data
         starts at that offset -> translate to a field for the
         starts at that offset -> translate to a field for the
         high level code generator }
         high level code generator }