mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 02:29:34 +02:00
- disable inlining for procedures with a formal const parameter, fixes
webtbs/tw4427 git-svn-id: trunk@1390 -
This commit is contained in:
parent
21dde458f5
commit
810ec85e34
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
19
tests/webtbs/tw4427.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user