* Fix anumval wrong overwriting as found out by Sergey

git-svn-id: trunk@17861 -
This commit is contained in:
pierre 2011-06-28 20:39:53 +00:00
parent 4f12937bb3
commit c07bcefb6b

View File

@ -1805,14 +1805,18 @@ implementation
if oneval<>'' then if oneval<>'' then
begin begin
if oneval[1]='-' then if oneval[1]='-' then
val(oneval,signedval,code) begin
val(oneval,signedval,code);
anumval:=qword(signedval);
end
else else
val(oneval,anumval,code); val(oneval,anumval,code);
if code<>0 then if code<>0 then
Comment(V_Error,'Invalid number '+avalue) Comment(V_Error,'Invalid number '+avalue)
else if (indexpos<MAXVAL) then else
begin
if (indexpos<MAXVAL) then
begin begin
anumval:=qword(signedval);
if source_info.endian<>target_info.endian then if source_info.endian<>target_info.endian then
swapendian(anumval); swapendian(anumval);
{ No range checking here } { No range checking here }
@ -1826,6 +1830,9 @@ implementation
else if bytesize=8 then else if bytesize=8 then
eightbytevalues[indexpos]:=anumval; eightbytevalues[indexpos]:=anumval;
inc(indexpos); inc(indexpos);
end
else
Comment(V_Error,'Buffer overrun in Order_values');
end; end;
end; end;
until allvals=''; until allvals='';