* no rangecheck for openarrays with cdecl

This commit is contained in:
peter 2002-12-20 18:13:19 +00:00
parent 420fb26f38
commit 9666a05942

View File

@ -74,7 +74,7 @@ interface
private private
procedure rangecheck_array; procedure rangecheck_array;
protected protected
function get_mul_size : aword; function get_mul_size : longint;
{# This routine is used to calculate the address of the reference. {# This routine is used to calculate the address of the reference.
On entry reg contains the index in the array, On entry reg contains the index in the array,
and l contains the size of each element in the array. and l contains the size of each element in the array.
@ -505,7 +505,7 @@ implementation
TCGVECNODE TCGVECNODE
*****************************************************************************} *****************************************************************************}
function tcgvecnode.get_mul_size : aword; function tcgvecnode.get_mul_size : longint;
begin begin
if nf_memindex in flags then if nf_memindex in flags then
get_mul_size:=1 get_mul_size:=1
@ -556,18 +556,22 @@ implementation
var var
freereg : boolean; freereg : boolean;
hightree : tnode; hightree : tnode;
srsym : tsym;
poslabel, poslabel,
neglabel : tasmlabel; neglabel : tasmlabel;
hreg : tregister; hreg : tregister;
href : treference;
pushed : tpushedsaved; pushed : tpushedsaved;
begin begin
if is_open_array(left.resulttype.def) or if is_open_array(left.resulttype.def) or
is_array_of_const(left.resulttype.def) then is_array_of_const(left.resulttype.def) then
begin
{ cdecl functions don't have high() so we can not check the range }
if not(aktprocdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
begin begin
{ Get high value } { Get high value }
hightree:=load_high_value(tvarsym(tloadnode(left).symtableentry)); hightree:=load_high_value(tvarsym(tloadnode(left).symtableentry));
{ it must be available }
if not assigned(hightree) then
internalerror(200212201);
firstpass(hightree); firstpass(hightree);
secondpass(hightree); secondpass(hightree);
{ generate compares } { generate compares }
@ -592,6 +596,7 @@ implementation
{ release hightree } { release hightree }
location_release(exprasmlist,hightree.location); location_release(exprasmlist,hightree.location);
hightree.free; hightree.free;
end;
end end
else else
if is_dynamic_array(left.resulttype.def) then if is_dynamic_array(left.resulttype.def) then
@ -919,7 +924,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.38 2002-12-17 22:19:33 peter Revision 1.39 2002-12-20 18:13:19 peter
* no rangecheck for openarrays with cdecl
Revision 1.38 2002/12/17 22:19:33 peter
* fixed pushing of records>8 bytes with stdcall * fixed pushing of records>8 bytes with stdcall
* simplified hightree loading * simplified hightree loading