mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 04:50:08 +02:00
* fixed node complexity calculation for certain inlinenodes
(mantis 12404) git-svn-id: trunk@12020 -
This commit is contained in:
parent
7c919b3c74
commit
7f8e9b8d35
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8604,6 +8604,7 @@ tests/webtbs/tw12242.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12249.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1228.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1229.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12404.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1250.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12508a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1251b.pp svneol=native#text/plain
|
||||
|
@ -798,13 +798,15 @@ implementation
|
||||
{ operation (add, sub, or, and }
|
||||
inc(result);
|
||||
{ left expression }
|
||||
inc(result,node_complexity(tbinarynode(p).left));
|
||||
inc(result,node_complexity(tcallparanode(tunarynode(p).left).left));
|
||||
if (result >= NODE_COMPLEXITY_INF) then
|
||||
begin
|
||||
result := NODE_COMPLEXITY_INF;
|
||||
exit;
|
||||
end;
|
||||
p := tbinarynode(p).right;
|
||||
p:=tcallparanode(tunarynode(p).left).right;
|
||||
if assigned(p) then
|
||||
p:=tcallparanode(p).left;
|
||||
end;
|
||||
else
|
||||
begin
|
||||
|
40
tests/webtbs/tw12404.pp
Normal file
40
tests/webtbs/tw12404.pp
Normal file
@ -0,0 +1,40 @@
|
||||
{ %norun }
|
||||
|
||||
{$mode objfpc}
|
||||
{$h+}
|
||||
{$inline on}
|
||||
unit tw12404;
|
||||
|
||||
interface
|
||||
|
||||
Type
|
||||
TMyClass = Class(TObject)
|
||||
Private
|
||||
FPos : integer;
|
||||
FChar : PChar;
|
||||
Function MyFunc : Char; inline;
|
||||
Function MyOtherFunction : Integer;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
Function TMyClass.MyFunc : Char; inline;
|
||||
|
||||
begin
|
||||
Inc(FPos);
|
||||
Inc(FChar);
|
||||
Result:=FChar^;
|
||||
end;
|
||||
|
||||
Function TMyClass.MyOtherFunction : Integer;
|
||||
|
||||
Var
|
||||
C : Char;
|
||||
|
||||
begin
|
||||
C:=MyFunc;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user