Переглянути джерело

* disallow 64-bit property index specifiers on 64-bit CPUs, since they were not
handled correctly there anyway (they were silently truncated to 32-bit)

git-svn-id: trunk@27061 -

nickysn 11 роки тому
батько
коміт
dcc2354760
3 змінених файлів з 19 додано та 2 видалено
  1. 1 0
      .gitattributes
  2. 0 2
      compiler/pdecvar.pas
  3. 18 0
      tests/tbf/tb0239.pp

+ 1 - 0
.gitattributes

@@ -9563,6 +9563,7 @@ tests/tbf/tb0235.pp svneol=native#text/pascal
 tests/tbf/tb0236.pp svneol=native#text/pascal
 tests/tbf/tb0237.pp svneol=native#text/pascal
 tests/tbf/tb0238.pp svneol=native#text/pascal
+tests/tbf/tb0239.pp svneol=native#text/pascal
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain

+ 0 - 2
compiler/pdecvar.pas

@@ -460,9 +460,7 @@ implementation
                      procedure matching requires equal parameters }
                    if is_constnode(pt) and
                       is_ordinal(pt.resultdef)
-{$ifndef cpu64bitaddr}
                       and (not is_64bitint(pt.resultdef))
-{$endif cpu64bitaddr}
                       then
                      begin
                        if is_integer(pt.resultdef) then

+ 18 - 0
tests/tbf/tb0239.pp

@@ -0,0 +1,18 @@
+{ %FAIL }
+program tb0239;
+
+{$MODE objfpc}
+
+type
+  TMyClass = class
+    function GetMyProperty(Index: Integer): Integer;
+    property MyProperty: Integer index 10000000000000000 read GetMyProperty;
+  end;
+
+function TMyClass.GetMyProperty(Index: Integer): Integer;
+begin
+  Result := 10;
+end;
+
+begin
+end.