From 03914cb1b32656b3d54a7c838666d32c8d2c1c4e Mon Sep 17 00:00:00 2001 From: Maximilian Downey Twiss <creatorsmithmdt@gmail.com> Date: Thu, 24 Nov 2022 19:00:01 +1100 Subject: [PATCH 39/56] java: Check that type is array or integer before checking string flag.
gcc/java/ChangeLog: * decl.cc (push_promoted_type): Check that type is array or integer before checking string flag. --- gcc/java/decl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/java/decl.cc b/gcc/java/decl.cc index 6319d1ce18a..6d7a4ae37bf 100644 --- a/gcc/java/decl.cc +++ b/gcc/java/decl.cc @@ -481,7 +481,8 @@ push_promoted_type (const char *name, tree actual_type) TYPE_MAX_VALUE (type) = copy_node (in_max); TREE_TYPE (TYPE_MAX_VALUE (type)) = type; TYPE_PRECISION (type) = TYPE_PRECISION (int_type_node); - TYPE_STRING_FLAG (type) = TYPE_STRING_FLAG (actual_type); + if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == INTEGER_TYPE) + TYPE_STRING_FLAG (type) = TYPE_STRING_FLAG (actual_type); layout_type (type); pushdecl (build_decl (input_location, TYPE_DECL, get_identifier (name), type)); -- 2.38.1