mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:09:20 +02:00
* patch by J. Gareth Moreton: fixes internal error 200405231 with inline, resolves #35590
git-svn-id: trunk@44119 -
This commit is contained in:
parent
38d0a9af48
commit
2d47013cd1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -17954,6 +17954,7 @@ tests/webtbs/tw3540.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3546.pp svneol=native#text/plain
|
tests/webtbs/tw3546.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw35533.pp svneol=native#text/pascal
|
tests/webtbs/tw35533.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3554.pp svneol=native#text/plain
|
tests/webtbs/tw3554.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw35590.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw35626.pp -text svneol=native#text/pascal
|
tests/webtbs/tw35626.pp -text svneol=native#text/pascal
|
||||||
tests/webtbs/tw3564.pp svneol=native#text/plain
|
tests/webtbs/tw3564.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3567.pp svneol=native#text/plain
|
tests/webtbs/tw3567.pp svneol=native#text/plain
|
||||||
|
@ -4815,7 +4815,10 @@ implementation
|
|||||||
assigned(hp^.def) and
|
assigned(hp^.def) and
|
||||||
is_managed_type(hp^.def) then
|
is_managed_type(hp^.def) then
|
||||||
begin
|
begin
|
||||||
include(current_procinfo.flags,pi_needs_implicit_finally);
|
{ If it needs an implicit finally block, the relevant flag should
|
||||||
|
have been set in the first pass. Note that we can't set it here
|
||||||
|
because "add_entry_exit_code" has already been called, and
|
||||||
|
setting the flag now will raise Internal Error 200405231. [Kit] }
|
||||||
tg.temp_to_ref(hp,href);
|
tg.temp_to_ref(hp,href);
|
||||||
g_finalize(list,hp^.def,href);
|
g_finalize(list,hp^.def,href);
|
||||||
end;
|
end;
|
||||||
|
35
tests/webtbs/tw35590.pp
Normal file
35
tests/webtbs/tw35590.pp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
{$inline on}
|
||||||
|
{$h+}
|
||||||
|
program project1;
|
||||||
|
|
||||||
|
function sLow: integer; inline;
|
||||||
|
begin result := 1; end;
|
||||||
|
|
||||||
|
function sHigh( const s: string): integer; inline;
|
||||||
|
begin result := Length(s); end;
|
||||||
|
|
||||||
|
procedure insert2( const substr: string; var s: string; index: integer);
|
||||||
|
begin insert( substr, s, index); end;
|
||||||
|
|
||||||
|
function replaceChars(const s, subStr: string): string;
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
result := s;
|
||||||
|
// ok with sHigh(s) or with non-inlined sHigh(result)
|
||||||
|
for i := sHigh(result) downto sLow() do begin
|
||||||
|
delete( result, i, 1);
|
||||||
|
insert2( subStr, result, i); // ok with (unwrapped) insert( subStr, result, i)
|
||||||
|
end;
|
||||||
|
end; // Error: Internal error 200405231
|
||||||
|
|
||||||
|
procedure test1;
|
||||||
|
var s, newChar, r: ansistring;
|
||||||
|
begin
|
||||||
|
s := 'old'; newChar := 'Replace';
|
||||||
|
r := replaceChars( s, newChar);
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
test1;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user