Sfoglia il codice sorgente

ninl.pas, tinlinenode.pass_typecheck: an intrinsic which has a generic type parameter as argument is left as is (e.g. a call) and thus this needs to be respected when typechecking a SizeOf. Fixes Mantis #21592.

git-svn-id: trunk@21497 -
svenbarth 13 anni fa
parent
commit
7332a0f801
3 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/ninl.pas
  3. 11 0
      tests/webtbs/tw21592b.pp

+ 1 - 0
.gitattributes

@@ -12601,6 +12601,7 @@ tests/webtbs/tw21551.pp svneol=native#text/plain
 tests/webtbs/tw2158.pp svneol=native#text/plain
 tests/webtbs/tw2159.pp svneol=native#text/plain
 tests/webtbs/tw21592.pp svneol=native#text/pascal
+tests/webtbs/tw21592b.pp svneol=native#text/pascal
 tests/webtbs/tw21593.pp svneol=native#text/pascal
 tests/webtbs/tw2163.pp svneol=native#text/plain
 tests/webtbs/tw21654.pp svneol=native#text/pascal

+ 2 - 1
compiler/ninl.pas

@@ -2474,7 +2474,8 @@ implementation
                 begin
                   { the constant evaluation of in_sizeof_x happens in pexpr where possible }
                   set_varstate(left,vs_read,[]);
-                  if paramanager.push_high_param(vs_value,left.resultdef,current_procinfo.procdef.proccalloption) then
+                  if (left.resultdef.typ<>undefineddef) and
+                      paramanager.push_high_param(vs_value,left.resultdef,current_procinfo.procdef.proccalloption) then
                    begin
                      hightree:=load_high_value_node(tparavarsym(tloadnode(left).symtableentry));
                      if assigned(hightree) then

+ 11 - 0
tests/webtbs/tw21592b.pp

@@ -0,0 +1,11 @@
+unit tw21592b;
+
+{$MODE DELPHI}
+
+interface
+
+type TBytesOverlay<T> = array [0..SizeOf(T) - 1] of Byte;
+
+implementation
+
+end.