From 803779002d5bdfae8960d95520a4e5e5107f61fd Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 27 Feb 2021 19:30:37 +0000 Subject: [PATCH] * the new constant string arraydefs are also implicit pointers types for JVM git-svn-id: trunk@48833 - --- compiler/defutil.pas | 9 +++++++++ compiler/jvm/jvmdef.pas | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/defutil.pas b/compiler/defutil.pas index 708cf44988..852d2cfa5a 100644 --- a/compiler/defutil.pas +++ b/compiler/defutil.pas @@ -149,6 +149,9 @@ interface {# Returns true, if p points to an array of const } function is_array_of_const(p : tdef) : boolean; + {# Returns true if p is an arraydef that describes a constant string } + function is_conststring_array(p : tdef) : boolean; + {# Returns true, if p points any kind of special array That is if the array is an open array, a variant @@ -821,6 +824,12 @@ implementation (ado_IsArrayOfConst in tarraydef(p).arrayoptions); end; + function is_conststring_array(p: tdef): boolean; + begin + result:=(p.typ=arraydef) and + (ado_IsConstString in tarraydef(p).arrayoptions); + end; + { true, if p points to a special array, bitpacked arrays aren't special in this regard though } function is_special_array(p : tdef) : boolean; begin diff --git a/compiler/jvm/jvmdef.pas b/compiler/jvm/jvmdef.pas index 658f76ed91..4a9e6b585c 100644 --- a/compiler/jvm/jvmdef.pas +++ b/compiler/jvm/jvmdef.pas @@ -517,7 +517,8 @@ implementation result:=(tarraydef(def).highrange>=tarraydef(def).lowrange) or is_open_array(def) or is_array_of_const(def) or - is_array_constructor(def); + is_array_constructor(def) or + is_conststring_array(def); filedef, recorddef, setdef: