Browse Source

* another internal error 99080501 fixed, resolves #41299

florian 1 month ago
parent
commit
e8b6075311
2 changed files with 16 additions and 1 deletions
  1. 3 1
      compiler/ncnv.pas
  2. 13 0
      tests/webtbs/tw41299.pp

+ 3 - 1
compiler/ncnv.pas

@@ -4672,9 +4672,11 @@ implementation
         { the same goes for changing the sign of equal-sized values which
           are smaller than an entire register }
         if result and
-           { don't try to check the size of an open array }
+           { don't try to check the size of an open array or an array of const }
            (is_open_array(resultdef) or
             is_open_array(left.resultdef) or
+            is_array_of_const(resultdef) or
+            is_array_of_const(left.resultdef) or
             (resultdef.size<left.resultdef.size) or
             ((resultdef.size=left.resultdef.size) and
              (left.resultdef.size<sizeof(aint)) and

+ 13 - 0
tests/webtbs/tw41299.pp

@@ -0,0 +1,13 @@
+{$mode delphi}
+program ie99080501;
+
+procedure proc(arg: array of const);
+var
+  p: TVarRec absolute arg;
+begin
+  writeln(PtrInt(@p)); // Error: Internal error 99080501
+end;
+
+begin
+  proc([100, 'foo', 'bar']);
+end.