mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 11:49:25 +02:00
* fix tw8191 for all architectures: skip code generation for range checking also when the range checking has to be done dynamically for pointers accessed as arrays which were typecasted from an array
git-svn-id: trunk@11037 -
This commit is contained in:
parent
d79851dc1b
commit
4aced9802c
@ -717,11 +717,14 @@ implementation
|
|||||||
{ offset can only differ from 0 if arraydef }
|
{ offset can only differ from 0 if arraydef }
|
||||||
case left.resultdef.typ of
|
case left.resultdef.typ of
|
||||||
arraydef :
|
arraydef :
|
||||||
|
begin
|
||||||
|
{ do not do any range checking when this is an array access to a pointer which has been
|
||||||
|
typecasted from an array }
|
||||||
|
if (not (ado_isconvertedpointer in tarraydef(left.resultdef).arrayoptions)) then
|
||||||
begin
|
begin
|
||||||
if not(is_open_array(left.resultdef)) and
|
if not(is_open_array(left.resultdef)) and
|
||||||
not(is_array_of_const(left.resultdef)) and
|
not(is_array_of_const(left.resultdef)) and
|
||||||
not(is_dynamic_array(left.resultdef)) and
|
not(is_dynamic_array(left.resultdef)) then
|
||||||
not(ado_isconvertedpointer in tarraydef(left.resultdef).arrayoptions) then
|
|
||||||
begin
|
begin
|
||||||
if (tordconstnode(right).value.svalue>tarraydef(left.resultdef).highrange) or
|
if (tordconstnode(right).value.svalue>tarraydef(left.resultdef).highrange) or
|
||||||
(tordconstnode(right).value.svalue<tarraydef(left.resultdef).lowrange) then
|
(tordconstnode(right).value.svalue<tarraydef(left.resultdef).lowrange) then
|
||||||
@ -742,6 +745,7 @@ implementation
|
|||||||
rangecheck_array;
|
rangecheck_array;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
stringdef :
|
stringdef :
|
||||||
begin
|
begin
|
||||||
if (cs_check_range in current_settings.localswitches) then
|
if (cs_check_range in current_settings.localswitches) then
|
||||||
|
Loading…
Reference in New Issue
Block a user