* fixed wrong typecasts

This commit is contained in:
peter 2004-11-09 17:26:47 +00:00
parent 5534e9ccae
commit 7c0b6e129e
5 changed files with 56 additions and 36 deletions

View File

@ -2161,12 +2161,14 @@ type
else else
{ not a procedure variable } { not a procedure variable }
begin begin
if procdefinition.deftype<>procdef then
internalerror(200411071);
{ calc the correture value for the register } { calc the correture value for the register }
{ handle predefined procedures } { handle predefined procedures }
if (procdefinition.proccalloption=pocall_inline) then if (procdefinition.proccalloption=pocall_inline) then
begin begin
{ inherit flags } { 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 if assigned(methodpointer) then
CGMessage(cg_e_unable_inline_object_methods); CGMessage(cg_e_unable_inline_object_methods);
@ -2413,7 +2415,10 @@ begin
end. end.
{ {
$Log$ $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 * tvarsym splitted
Revision 1.257 2004/11/02 12:55:16 peter Revision 1.257 2004/11/02 12:55:16 peter

View File

@ -364,7 +364,7 @@ implementation
end; end;
labelsym : labelsym :
begin 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; end;
else internalerror(4); else internalerror(4);
end; end;
@ -957,7 +957,10 @@ begin
end. end.
{ {
$Log$ $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 * tvarsym splitted
Revision 1.130 2004/11/01 15:32:12 peter Revision 1.130 2004/11/01 15:32:12 peter

View File

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

View File

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

View File

@ -427,7 +427,7 @@ implementation
else else
Message(parser_e_illegal_expression); Message(parser_e_illegal_expression);
end; end;
hp:=tbinarynode(hp).left; hp:=tunarynode(hp).left;
end; end;
srsym:=tloadnode(hp).symtableentry; srsym:=tloadnode(hp).symtableentry;
case srsym.typ of case srsym.typ of
@ -1089,7 +1089,10 @@ implementation
end. end.
{ {
$Log$ $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 * tvarsym splitted
Revision 1.94 2004/11/01 23:30:11 peter Revision 1.94 2004/11/01 23:30:11 peter