mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 13:50:20 +02:00
* fix for Mantis #37187: inside generics the constant code in pexpr does not handle all cases and thus current_procinfo needs to be checked as well
+ added test git-svn-id: trunk@46218 -
This commit is contained in:
parent
06a5ec5b5c
commit
8770af84bd
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18381,6 +18381,7 @@ tests/webtbs/tw37107.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37130.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37136.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37154.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37187.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3719.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3721.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37218.pp svneol=native#text/pascal
|
||||
|
@ -2970,9 +2970,11 @@ implementation
|
||||
|
||||
in_sizeof_x:
|
||||
begin
|
||||
{ the constant evaluation of in_sizeof_x happens in pexpr where possible }
|
||||
{ the constant evaluation of in_sizeof_x happens in pexpr where possible,
|
||||
though for generics it can reach here as well }
|
||||
set_varstate(left,vs_read,[]);
|
||||
if (left.resultdef.typ<>undefineddef) and
|
||||
assigned(current_procinfo) and
|
||||
paramanager.push_high_param(vs_value,left.resultdef,current_procinfo.procdef.proccalloption) then
|
||||
begin
|
||||
{ this should be an open array or array of const, both of
|
||||
|
19
tests/webtbs/tw37187.pp
Normal file
19
tests/webtbs/tw37187.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw37187;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic TTest<T: class> = class
|
||||
arr: array[0..SizeOf(T)] of Byte;
|
||||
end;
|
||||
|
||||
generic TTest2<T: class> = class
|
||||
public type
|
||||
TTestT = specialize TTest<T>;
|
||||
end;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user