Explorar el Código

Merged revisions 28,38,48,56 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@355 -

peter hace 20 años
padre
commit
2cb661c591
Se han modificado 4 ficheros con 22 adiciones y 1 borrados
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/htypechk.pas
  3. 1 1
      compiler/nmem.pas
  4. 17 0
      tests/tbs/tb0490.pp

+ 1 - 0
.gitattributes

@@ -4737,6 +4737,7 @@ tests/tbs/tb0486.pp svneol=native#text/plain
 tests/tbs/tb0487.pp svneol=native#text/plain
 tests/tbs/tb0488.pp svneol=native#text/plain
 tests/tbs/tb0489.pp svneol=native#text/plain
+tests/tbs/tb0490.pp svneol=native#text/plain
 tests/tbs/tb0492.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain

+ 3 - 0
compiler/htypechk.pas

@@ -1097,6 +1097,9 @@ implementation
                       (valid_addr in opts) and
                       (hp.resulttype.def.deftype=stringdef) then
                      result:=true
+                 else
+                   if valid_const in opts then
+                     result:=true
                  else
                   CGMessagePos(hp.fileinfo,errmsg);
                  exit;

+ 1 - 1
compiler/nmem.pas

@@ -662,7 +662,7 @@ implementation
             not(is_char(right.resulttype.def)) and
             not(is_boolean(right.resulttype.def)) then
            begin
-             inserttypeconv(right,s32inttype);
+             inserttypeconv(right,sinttype);
            end;
 
          case left.resulttype.def.deftype of

+ 17 - 0
tests/tbs/tb0490.pp

@@ -0,0 +1,17 @@
+type
+  trecord = record
+    l : longint;
+  end;
+
+function test : trecord;
+  begin
+  end;
+
+procedure p(const c);
+  begin
+  end;
+
+begin
+  p(test);
+end.
+