mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 13:29:27 +02:00
* don't generate typed constant initialisers for set and enum constants
declared local to functions on the JVM target, because we don't generate field constants for them (fixes run time error when declaring a symbolic enum/set constant in a function on the JVM target) git-svn-id: trunk@25953 -
This commit is contained in:
parent
8fe7d82db7
commit
3ed60082d3
@ -226,8 +226,11 @@ implementation
|
||||
{$ifdef jvm}
|
||||
{ for the JVM target, some constants need to be
|
||||
initialized at run time (enums, sets) -> create fake
|
||||
typed const to do so }
|
||||
if assigned(tconstsym(sym).constdef) and
|
||||
typed const to do so (at least if they are visible
|
||||
outside this routine, since we won't directly access
|
||||
these symbols in the generated code) }
|
||||
if (symtablestack.top.symtablelevel<normal_function_level) and
|
||||
assigned(tconstsym(sym).constdef) and
|
||||
(tconstsym(sym).constdef.typ in [enumdef,setdef]) then
|
||||
jvm_add_typed_const_initializer(tconstsym(sym));
|
||||
{$endif}
|
||||
|
Loading…
Reference in New Issue
Block a user