فهرست منبع

* don't use a vecnode to convert a dynamic array or an array constructor to a pointer as that will lead to problems with range checking if the array should be empty; fixes run of tarray12 with -Cr

git-svn-id: trunk@38368 -
svenbarth 7 سال پیش
والد
کامیت
0e5a598b6a
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      compiler/ninl.pas

+ 5 - 2
compiler/ninl.pas

@@ -4725,7 +4725,10 @@ implementation
                begin
                  datatemp:=ctempcreatenode.create_value(first,first.size,tt_normal,false,firstn);
                  addstatement(insertstatement,datatemp);
-                 datan:=caddrnode.create_internal(cvecnode.create(ctemprefnode.create(datatemp),cordconstnode.create(0,sizesinttype,false)));
+                 if is_dynamic_array(first) then
+                   datan:=ctypeconvnode.create_internal(ctemprefnode.create(datatemp),voidpointertype)
+                 else
+                   datan:=caddrnode.create_internal(cvecnode.create(ctemprefnode.create(datatemp),cordconstnode.create(0,sizesinttype,false)));
                  datacountn:=cinlinenode.create(in_length_x,false,ctemprefnode.create(datatemp));
                end
              else if isconstr then
@@ -4733,7 +4736,7 @@ implementation
                  inserttypeconv(firstn,second);
                  datatemp:=ctempcreatenode.create_value(second,second.size,tt_normal,false,firstn);
                  addstatement(insertstatement,datatemp);
-                 datan:=caddrnode.create_internal(cvecnode.create(ctemprefnode.create(datatemp),cordconstnode.create(0,sizesinttype,false)));
+                 datan:=ctypeconvnode.create_internal(ctemprefnode.create(datatemp),voidpointertype);
                  datacountn:=cinlinenode.create(in_length_x,false,ctemprefnode.create(datatemp));
                end
              else