- disable inlining for procedures with a formal const parameter, fixes

webtbs/tw4427

git-svn-id: trunk@1390 -
This commit is contained in:
Jonas Maebe 2005-10-15 20:48:35 +00:00
parent 21dde458f5
commit 810ec85e34
3 changed files with 21 additions and 1 deletions

1
.gitattributes vendored
View File

@ -6318,6 +6318,7 @@ tests/webtbs/tw4350.pp svneol=native#text/plain
tests/webtbs/tw4388.pp svneol=native#text/plain
tests/webtbs/tw4390.pp svneol=native#text/plain
tests/webtbs/tw4398.pp svneol=native#text/plain
tests/webtbs/tw4427.pp svneol=native#text/plain
tests/webtbs/tw4428.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -972,7 +972,7 @@ implementation
{ we can't handle formaldefs and special arrays (the latter may need a }
{ re-basing of the index, i.e. if you pass an array[1..10] as open array, }
{ you have to add 1 to all index operations if you directly inline it }
if ((currpara.varspez in [vs_out,vs_var]) and
if ((currpara.varspez in [vs_out,vs_var,vs_const]) and
(currpara.vartype.def.deftype=formaldef)) or
is_special_array(currpara.vartype.def) then
exit;

19
tests/webtbs/tw4427.pp Normal file
View File

@ -0,0 +1,19 @@
{$inline on}
type
pbyte = ^byte;
procedure test(p: pchar);
begin
if pbyte(p)^ <> 0 then
halt(1);
end;
procedure test(const p); inline;
begin
test(pchar(@p));
end;
begin
test(#0);
end.