فهرست منبع

* fixed wrong typecasts

peter 21 سال پیش
والد
کامیت
7c0b6e129e
5فایلهای تغییر یافته به همراه56 افزوده شده و 36 حذف شده
  1. 7 2
      compiler/ncal.pas
  2. 5 2
      compiler/ncgld.pas
  3. 5 2
      compiler/ncgutil.pas
  4. 34 28
      compiler/pdecsub.pas
  5. 5 2
      compiler/ptconst.pas

+ 7 - 2
compiler/ncal.pas

@@ -2161,12 +2161,14 @@ type
          else
          { not a procedure variable }
            begin
+	      if procdefinition.deftype<>procdef then
+	        internalerror(200411071);
               { calc the correture value for the register }
               { handle predefined procedures }
               if (procdefinition.proccalloption=pocall_inline) then
                 begin
                    { inherit flags }
-                   current_procinfo.flags := current_procinfo.flags + ((procdefinition as tprocdef).inlininginfo^.flags*inherited_inlining_flags);
+                   current_procinfo.flags := current_procinfo.flags + (tprocdef(procdefinition).inlininginfo^.flags*inherited_inlining_flags);
 
                    if assigned(methodpointer) then
                      CGMessage(cg_e_unable_inline_object_methods);
@@ -2413,7 +2415,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.258  2004-11-08 22:09:58  peter
+  Revision 1.259  2004-11-09 17:26:47  peter
+    * fixed wrong typecasts
+
+  Revision 1.258  2004/11/08 22:09:58  peter
     * tvarsym splitted
 
   Revision 1.257  2004/11/02 12:55:16  peter

+ 5 - 2
compiler/ncgld.pas

@@ -364,7 +364,7 @@ implementation
                end;
             labelsym :
                begin
-                  location.reference.symbol:=objectlibrary.newasmsymbol(ttypedconstsym(symtableentry).mangledname,AB_EXTERNAL,AT_FUNCTION);
+                  location.reference.symbol:=objectlibrary.newasmsymbol(tlabelsym(symtableentry).mangledname,AB_EXTERNAL,AT_FUNCTION);
                end;
             else internalerror(4);
          end;
@@ -957,7 +957,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.131  2004-11-08 22:09:59  peter
+  Revision 1.132  2004-11-09 17:26:47  peter
+    * fixed wrong typecasts
+
+  Revision 1.131  2004/11/08 22:09:59  peter
     * tvarsym splitted
 
   Revision 1.130  2004/11/01 15:32:12  peter

+ 5 - 2
compiler/ncgutil.pas

@@ -2084,7 +2084,7 @@ implementation
            (po_assembler in pd.procoptions) then
           exit;
         { for localloc <> LOC_REFERENCE, we need regvar support inside inlined procedures }
-        with tlocalvarsym(pd.funcretsym) do
+        with tabstractnormalvarsym(pd.funcretsym) do
           begin
             localloc.loc:=LOC_REFERENCE;
             localloc.size:=int_cgsize(paramanager.push_size(varspez,vartype.def,pocall_inline));
@@ -2212,7 +2212,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.238  2004-11-08 22:09:59  peter
+  Revision 1.239  2004-11-09 17:26:47  peter
+    * fixed wrong typecasts
+
+  Revision 1.238  2004/11/08 22:09:59  peter
     * tvarsym splitted
 
   Revision 1.237  2004/11/08 20:23:29  florian

+ 34 - 28
compiler/pdecsub.pas

@@ -502,7 +502,7 @@ implementation
                       if assigned(defaultvalue) then
                         begin
                           include(defaultvalue.symoptions,sp_internal);
-                          tprocdef(pd).parast.insert(defaultvalue);
+                          pd.parast.insert(defaultvalue);
                         end;
                       defaultrequired:=true;
                     end
@@ -574,6 +574,7 @@ implementation
       var
         orgsp,sp : stringid;
         sym : tsym;
+	srsym : tsym;
         srsymtable : tsymtable;
         storepos,
         procstartfilepos : tfileposinfo;
@@ -697,10 +698,10 @@ implementation
            repeat
              searchagain:=false;
              akttokenpos:=procstartfilepos;
-             aprocsym:=tprocsym(symtablestack.search(sp));
+             srsym:=tsym(symtablestack.search(sp));
 
              if not(parse_only) and
-                not assigned(aprocsym) and
+                not assigned(srsym) and
                 (symtablestack.symtabletype=staticsymtable) and
                 assigned(symtablestack.next) and
                 (symtablestack.next.unitid=0) then
@@ -712,33 +713,35 @@ implementation
 
                    We need to find out if the procedure is global. If it is
                    global, it is in the global symtable.}
-                 aprocsym:=tprocsym(symtablestack.next.search(sp));
+                 srsym:=tsym(symtablestack.next.search(sp));
                end;
 
              { Check if overloaded is a procsym }
-             if assigned(aprocsym) and
-                (aprocsym.typ<>procsym) then
-              begin
-                { when the other symbol is a unit symbol then hide the unit
-                  symbol }
-                if (aprocsym.typ=unitsym) then
-                 begin
-                   aprocsym.owner.rename(aprocsym.name,'hidden'+aprocsym.name);
-                   searchagain:=true;
-                 end
-                else
-                 begin
-                   {  we use a different error message for tp7 so it looks more compatible }
-                   if (m_fpc in aktmodeswitches) then
-                    Message1(parser_e_overloaded_no_procedure,aprocsym.realname)
-                   else
-                    tstoredsymtable(symtablestack).DuplicateSym(nil,aprocsym);
-                   { rename the name to an unique name to avoid an
-                     error when inserting the symbol in the symtable }
-                   orgsp:=orgsp+'$'+tostr(aktfilepos.line);
-                   { generate a new aktprocsym }
-                   aprocsym:=nil;
-                 end;
+             if assigned(srsym) then
+	       begin
+	         if srsym.typ=procsym then
+		   aprocsym:=tprocsym(srsym)
+		 else
+                   begin
+                     { when the other symbol is a unit symbol then hide the unit
+                       symbol }
+                     if (srsym.typ=unitsym) then
+                      begin
+                        srsym.owner.rename(srsym.name,'hidden'+srsym.name);
+                        searchagain:=true;
+                      end
+                     else
+                      begin
+                        {  we use a different error message for tp7 so it looks more compatible }
+                        if (m_fpc in aktmodeswitches) then
+                         Message1(parser_e_overloaded_no_procedure,srsym.realname)
+                        else
+                         tstoredsymtable(symtablestack).DuplicateSym(nil,srsym);
+                        { rename the name to an unique name to avoid an
+                          error when inserting the symbol in the symtable }
+                        orgsp:=orgsp+'$'+tostr(aktfilepos.line);
+                      end;
+ 	           end;
               end;
            until not searchagain;
          end;
@@ -2263,7 +2266,10 @@ const
 end.
 {
   $Log$
-  Revision 1.200  2004-11-08 22:09:59  peter
+  Revision 1.201  2004-11-09 17:26:47  peter
+    * fixed wrong typecasts
+
+  Revision 1.200  2004/11/08 22:09:59  peter
     * tvarsym splitted
 
   Revision 1.199  2004/11/05 21:16:55  peter

+ 5 - 2
compiler/ptconst.pas

@@ -427,7 +427,7 @@ implementation
                                else
                                  Message(parser_e_illegal_expression);
                              end;
-                             hp:=tbinarynode(hp).left;
+                             hp:=tunarynode(hp).left;
                           end;
                         srsym:=tloadnode(hp).symtableentry;
                         case srsym.typ of
@@ -1089,7 +1089,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.95  2004-11-08 22:09:59  peter
+  Revision 1.96  2004-11-09 17:26:47  peter
+    * fixed wrong typecasts
+
+  Revision 1.95  2004/11/08 22:09:59  peter
     * tvarsym splitted
 
   Revision 1.94  2004/11/01 23:30:11  peter