* don't change current_filepos in pass_typecheck when not generating

errornodes (so the that the parser won't afterwards suddenly start
    creating nodes with this different fileinfo)

git-svn-id: trunk@13577 -
This commit is contained in:
Jonas Maebe 2009-08-22 20:21:56 +00:00
parent 8dbc728926
commit acdb0bbb3e
3 changed files with 5 additions and 4 deletions

View File

@ -750,8 +750,7 @@ implementation
not(is_open_string(parasym.vardef)) and not(is_open_string(parasym.vardef)) and
not(equal_defs(left.resultdef,parasym.vardef)) then not(equal_defs(left.resultdef,parasym.vardef)) then
begin begin
current_filepos:=left.fileinfo; CGMessagePos(left.fileinfo,type_e_strict_var_string_violation);
CGMessage(type_e_strict_var_string_violation);
end; end;
{ Handle formal parameters separate } { Handle formal parameters separate }

View File

@ -363,6 +363,7 @@ implementation
l : Longint; l : Longint;
lr,hr : TConstExprInt; lr,hr : TConstExprInt;
hp : tarrayconstructornode; hp : tarrayconstructornode;
oldfilepos: tfileposinfo;
begin begin
if p.nodetype<>arrayconstructorn then if p.nodetype<>arrayconstructorn then
internalerror(200205105); internalerror(200205105);
@ -407,6 +408,7 @@ implementation
end; end;
if codegenerror then if codegenerror then
break; break;
oldfilepos:=current_filepos;
current_filepos:=p2.fileinfo; current_filepos:=p2.fileinfo;
case p2.resultdef.typ of case p2.resultdef.typ of
enumdef, enumdef,
@ -535,6 +537,7 @@ implementation
hp:=tarrayconstructornode(tarrayconstructornode(p2).right); hp:=tarrayconstructornode(tarrayconstructornode(p2).right);
tarrayconstructornode(p2).right:=nil; tarrayconstructornode(p2).right:=nil;
p2.free; p2.free;
current_filepos:=oldfilepos;
end; end;
if (hdef=nil) then if (hdef=nil) then
hdef:=u8inttype; hdef:=u8inttype;

View File

@ -384,8 +384,7 @@ implementation
(left.nodetype in [stringconstn]) (left.nodetype in [stringconstn])
) then ) then
begin begin
current_filepos:=left.fileinfo; CGMessagePos(left.fileinfo,type_e_no_addr_of_constant);
CGMessage(type_e_no_addr_of_constant);
exit; exit;
end; end;