diff --git a/.gitattributes b/.gitattributes index 4f881345ef..c24f468e7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13796,6 +13796,7 @@ tests/webtbs/tw2536.pp svneol=native#text/plain tests/webtbs/tw25361.pp svneol=native#text/plain tests/webtbs/tw2540.pp svneol=native#text/plain tests/webtbs/tw25551.pp svneol=native#text/plain +tests/webtbs/tw25598.pp svneol=native#text/plain tests/webtbs/tw2561.pp svneol=native#text/plain tests/webtbs/tw2588.pp svneol=native#text/plain tests/webtbs/tw2589.pp svneol=native#text/plain @@ -14572,6 +14573,7 @@ tests/webtbs/uw25059.pp svneol=native#text/pascal tests/webtbs/uw25059.test.pp svneol=native#text/pascal tests/webtbs/uw25059.withdot.pp svneol=native#text/pascal tests/webtbs/uw25132.pp svneol=native#text/pascal +tests/webtbs/uw25598.pp svneol=native#text/plain tests/webtbs/uw2706a.pp svneol=native#text/plain tests/webtbs/uw2706b.pp svneol=native#text/plain tests/webtbs/uw2731.pp svneol=native#text/plain diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 48d5eeb98b..43e07a2768 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -3449,7 +3449,7 @@ implementation { Check if we can inline the procedure when it references proc/var that are not in the globally available } st:=procdefinition.owner; - if (st.symtabletype=ObjectSymtable) then + while (st.symtabletype in [ObjectSymtable,recordsymtable]) do st:=st.defowner.owner; if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and (st.symtabletype=globalsymtable) and diff --git a/tests/webtbs/tw25598.pp b/tests/webtbs/tw25598.pp new file mode 100644 index 0000000000..6fdad62e45 --- /dev/null +++ b/tests/webtbs/tw25598.pp @@ -0,0 +1,6 @@ +uses uw25598; + +begin + TR.Foo; // Error: Undefined symbol: TC_$R03U01_$$_C +end. + diff --git a/tests/webtbs/uw25598.pp b/tests/webtbs/uw25598.pp new file mode 100644 index 0000000000..59f3dd0855 --- /dev/null +++ b/tests/webtbs/uw25598.pp @@ -0,0 +1,22 @@ +unit uw25598; + +{$mode delphi} + +interface + +type + TR = record + class function Foo: Integer; static; inline; + end; + +implementation + +const + C: array[0..0] of byte = (0); + +class function TR.Foo: Integer; inline; +begin + Result := C[0]; +end; + +end.