From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from qproxy5-pub.mail.unifiedlayer.com (qproxy5-pub.mail.unifiedlayer.com [69.89.21.30]) by sourceware.org (Postfix) with ESMTPS id 65408385B522 for ; Mon, 13 Mar 2023 22:08:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65408385B522 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from gproxy2-pub.mail.unifiedlayer.com (gproxy2-pub.mail.unifiedlayer.com [69.89.18.3]) by qproxy5.mail.unifiedlayer.com (Postfix) with ESMTP id ABC01803C0FE for ; Mon, 13 Mar 2023 22:08:38 +0000 (UTC) Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway4.mail.pro1.eigbox.com (Postfix) with ESMTP id 9B24C1004A41C for ; Mon, 13 Mar 2023 22:08:08 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id bqKupfLIPHIU4bqKupFyCA; Mon, 13 Mar 2023 22:08:08 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=NfUja0P4 c=1 sm=1 tr=0 ts=640f9ec8 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=k__wU0fu6RkA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=sNErSq7xPTn2lsUXLlAA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SsPWiHomN9k8ATad6+0mOfCeqttRTFvcaMsbU+HR8R0=; b=TKP1hRfOaK1j7S4djzLSdIbh3/ Iw7eKrP9QyP7VyI2kX+1eWP7XbZH4uq+rzs82ZlTBIzCNKG58YTEt4BhcvLerkGHkHX04Fw1JSLCg Xw3UX2jxfLLy4pri9VWxEwXvo; Received: from 71-211-185-113.hlrn.qwest.net ([71.211.185.113]:52788 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pbqKu-000u2m-Db for gdb-patches@sourceware.org; Mon, 13 Mar 2023 16:08:08 -0600 From: Tom Tromey Date: Mon, 13 Mar 2023 16:08:14 -0600 Subject: [PATCH 14/20] Use type allocator for range types MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230313-split-objfile-type-allocator-2-v1-14-69ba773ac17b@tromey.com> References: <20230313-split-objfile-type-allocator-2-v1-0-69ba773ac17b@tromey.com> In-Reply-To: <20230313-split-objfile-type-allocator-2-v1-0-69ba773ac17b@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.185.113 X-Source-L: No X-Exim-ID: 1pbqKu-000u2m-Db X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-185-113.hlrn.qwest.net ([192.168.0.21]) [71.211.185.113]:52788 X-Source-Auth: tom+tromey.com X-Email-Count: 15 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3026.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This changes the range type creation functions to accept a type allocator, and updates all the callers. Note that symbol readers should generally allocate on the relevant objfile, regardless of the underlying type of the range, which is what this patch implements. --- gdb/ada-lang.c | 27 ++++++++++++++++----------- gdb/coffread.c | 3 ++- gdb/ctfread.c | 3 ++- gdb/dwarf2/read.c | 18 +++++++++++------- gdb/f-exp.y | 7 ++++--- gdb/f-lang.c | 12 ++++++++---- gdb/gdbtypes.c | 34 +++++++++++++--------------------- gdb/gdbtypes.h | 13 +++++++++---- gdb/mdebugread.c | 7 +++++-- gdb/stabsread.c | 8 +++++--- gdb/valops.c | 6 ++++-- 11 files changed, 79 insertions(+), 59 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index b1c8912b0ea..cfb8d6e1110 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2141,15 +2141,15 @@ ada_type_of_array (struct value *arr, int bounds) while (arity > 0) { type_allocator alloc (arr->type ()); - struct type *range_type = alloc.new_type (); struct type *array_type = alloc.new_type (); struct value *low = desc_one_bound (descriptor, arity, 0); struct value *high = desc_one_bound (descriptor, arity, 1); arity -= 1; - create_static_range_type (range_type, low->type (), - longest_to_int (value_as_long (low)), - longest_to_int (value_as_long (high))); + struct type *range_type + = create_static_range_type (alloc, low->type (), + longest_to_int (value_as_long (low)), + longest_to_int (value_as_long (high))); elt_type = create_array_type (array_type, elt_type, range_type); if (ada_is_unconstrained_packed_array_type (arr->type ())) @@ -3094,8 +3094,9 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type, { struct type *type0 = ada_check_typedef (type); struct type *base_index_type = type0->index_type ()->target_type (); + type_allocator alloc (base_index_type); struct type *index_type - = create_static_range_type (NULL, base_index_type, low, high); + = create_static_range_type (alloc, base_index_type, low, high); struct type *slice_type = create_array_type_with_stride (NULL, type0->target_type (), index_type, type0->dyn_prop (DYN_PROP_BYTE_STRIDE), @@ -3128,8 +3129,9 @@ ada_value_slice (struct value *array, int low, int high) { struct type *type = ada_check_typedef (array->type ()); struct type *base_index_type = type->index_type ()->target_type (); + type_allocator alloc (type->index_type ()); struct type *index_type - = create_static_range_type (NULL, type->index_type (), low, high); + = create_static_range_type (alloc, type->index_type (), low, high); struct type *slice_type = create_array_type_with_stride (NULL, type->target_type (), index_type, type->dyn_prop (DYN_PROP_BYTE_STRIDE), @@ -3400,9 +3402,10 @@ static struct value * empty_array (struct type *arr_type, int low, int high) { struct type *arr_type0 = ada_check_typedef (arr_type); + type_allocator alloc (arr_type0->index_type ()->target_type ()); struct type *index_type = create_static_range_type - (NULL, arr_type0->index_type ()->target_type (), low, + (alloc, arr_type0->index_type ()->target_type (), low, high < low ? low - 1 : high); struct type *elt_type = ada_array_element_type (arr_type0, 1); @@ -11515,8 +11518,10 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) if (L < INT_MIN || U > INT_MAX) return raw_type; else - return create_static_range_type (type_allocator (raw_type).new_type (), - raw_type, L, U); + { + type_allocator alloc (raw_type); + return create_static_range_type (alloc, raw_type, L, U); + } } else { @@ -11567,8 +11572,8 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) } } - type = create_static_range_type (type_allocator (raw_type).new_type (), - base_type, L, U); + type_allocator alloc (raw_type); + type = create_static_range_type (alloc, base_type, L, U); /* create_static_range_type alters the resulting type's length to match the size of the base_type, which is not what we want. Set it back to the original range type's length. */ diff --git a/gdb/coffread.c b/gdb/coffread.c index 6b2ba96c997..170f7761444 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1778,8 +1778,9 @@ decode_type (struct coff_symbol *cs, unsigned int c_type, base_type = decode_type (cs, new_c_type, aux, objfile); index_type = objfile_type (objfile)->builtin_int; + type_allocator alloc (objfile); range_type - = create_static_range_type (NULL, index_type, 0, n - 1); + = create_static_range_type (alloc, index_type, 0, n - 1); type = create_array_type (NULL, base_type, range_type); } diff --git a/gdb/ctfread.c b/gdb/ctfread.c index ea557195997..3453800079e 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -831,7 +831,8 @@ read_array_type (struct ctf_context *ccp, ctf_id_t tid) if (idx_type == nullptr) idx_type = objfile_type (objfile)->builtin_int; - range_type = create_static_range_type (NULL, idx_type, 0, ar.ctr_nelems - 1); + type_allocator alloc (objfile); + range_type = create_static_range_type (alloc, idx_type, 0, ar.ctr_nelems - 1); type = create_array_type (NULL, element_type, range_type); if (ar.ctr_nelems <= 1) /* Check if undefined upper bound. */ { diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 73efd295422..83be77da3ea 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -13547,7 +13547,8 @@ quirk_ada_thick_pointer (struct die_info *die, struct dwarf2_cu *cu, range_fields[i + 1].set_name (objfile->intern (name)); } - struct type *bounds = type_allocator (objfile).new_type (); + type_allocator alloc (objfile); + struct type *bounds = alloc.new_type (); bounds->set_code (TYPE_CODE_STRUCT); bounds->set_num_fields (range_fields.size ()); @@ -13571,7 +13572,7 @@ quirk_ada_thick_pointer (struct die_info *die, struct dwarf2_cu *cu, gdb_assert (iter->code () == TYPE_CODE_ARRAY); iter->main_type->dyn_prop_list = nullptr; iter->set_index_type - (create_static_range_type (NULL, bounds->field (i).type (), 1, 0)); + (create_static_range_type (alloc, bounds->field (i).type (), 1, 0)); iter = iter->target_type (); } @@ -13655,7 +13656,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) if (die->child == NULL) { index_type = objfile_type (objfile)->builtin_int; - range_type = create_static_range_type (NULL, index_type, 0, -1); + type_allocator alloc (objfile); + range_type = create_static_range_type (alloc, index_type, 0, -1); type = create_array_type_with_stride (NULL, element_type, range_type, byte_stride_prop, bit_stride); return set_die_type (die, type, cu); @@ -14496,14 +14498,15 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) } index_type = objfile_type (objfile)->builtin_int; + type_allocator alloc (objfile); if (length_is_constant) - range_type = create_static_range_type (NULL, index_type, 1, length); + range_type = create_static_range_type (alloc, index_type, 1, length); else { struct dynamic_prop low_bound; low_bound.set_const_val (1); - range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0); + range_type = create_range_type (alloc, index_type, &low_bound, &prop, 0); } char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); @@ -15713,6 +15716,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) } } + type_allocator alloc (cu->per_objfile->objfile); if (attr_byte_stride != nullptr || attr_bit_stride != nullptr) { @@ -15721,11 +15725,11 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) = byte_stride_p ? &byte_stride_prop : &bit_stride_prop; range_type - = create_range_type_with_stride (NULL, orig_base_type, &low, + = create_range_type_with_stride (alloc, orig_base_type, &low, &high, bias, stride, byte_stride_p); } else - range_type = create_range_type (NULL, orig_base_type, &low, &high, bias); + range_type = create_range_type (alloc, orig_base_type, &low, &high, bias); if (high_bound_is_count) range_type->bounds ()->flag_upper_bound_is_count = 1; diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 30da537ea84..9ff8e1988fc 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -669,10 +669,11 @@ ptype : typebase array_size = type_stack->pop_int (); if (array_size != -1) { + struct type *idx_type + = parse_f_type (pstate)->builtin_integer; + type_allocator alloc (idx_type); range_type = - create_static_range_type ((struct type *) NULL, - parse_f_type (pstate) - ->builtin_integer, + create_static_range_type (alloc, idx_type, 0, array_size - 1); follow_type = create_array_type ((struct type *) NULL, diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 3fc43346b05..2da50b27267 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -131,8 +131,9 @@ fortran_bounds_all_dims (bool lbound_p, int ndimensions = calc_f77_array_dims (array_type); /* Allocate a result value of the correct type. */ + type_allocator alloc (gdbarch); struct type *range - = create_static_range_type (nullptr, + = create_static_range_type (alloc, builtin_f_type (gdbarch)->builtin_integer, 1, ndimensions); struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer; @@ -714,8 +715,9 @@ fortran_array_shape (struct gdbarch *gdbarch, const language_defn *lang, ndimensions = calc_f77_array_dims (val_type); /* Allocate a result value of the correct type. */ + type_allocator alloc (gdbarch); struct type *range - = create_static_range_type (nullptr, + = create_static_range_type (alloc, builtin_type (gdbarch)->builtin_int, 1, ndimensions); struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer; @@ -1393,8 +1395,9 @@ fortran_undetermined::value_subarray (value *array, p_high.set_const_val (d.high); p_stride.set_const_val (d.stride); + type_allocator alloc (d.index->target_type ()); struct type *new_range - = create_range_type_with_stride ((struct type *) NULL, + = create_range_type_with_stride (alloc, d.index->target_type (), &p_low, &p_high, 0, &p_stride, true); @@ -1429,8 +1432,9 @@ fortran_undetermined::value_subarray (value *array, p_high.set_const_val (d.high); p_stride.set_const_val (repacked_array_type->length ()); + type_allocator alloc (d.index->target_type ()); struct type *new_range - = create_range_type_with_stride ((struct type *) NULL, + = create_range_type_with_stride (alloc, d.index->target_type (), &p_low, &p_high, 0, &p_stride, true); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 103818fae9b..587f953fa09 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -933,7 +933,7 @@ operator== (const range_bounds &l, const range_bounds &r) HIGH_BOUND, inclusive. See create_range_type for further details. */ struct type * -create_range_type (struct type *result_type, struct type *index_type, +create_range_type (type_allocator &alloc, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, LONGEST bias) @@ -943,8 +943,7 @@ create_range_type (struct type *result_type, struct type *index_type, gdb_assert (index_type->code () != TYPE_CODE_VOID); gdb_assert (index_type->length () > 0); - if (result_type == NULL) - result_type = type_allocator (index_type).new_type (); + struct type *result_type = alloc.new_type (); result_type->set_code (TYPE_CODE_RANGE); result_type->set_target_type (index_type); if (index_type->is_stub ()) @@ -996,7 +995,7 @@ create_range_type (struct type *result_type, struct type *index_type, /* See gdbtypes.h. */ struct type * -create_range_type_with_stride (struct type *result_type, +create_range_type_with_stride (type_allocator &alloc, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, @@ -1004,8 +1003,8 @@ create_range_type_with_stride (struct type *result_type, const struct dynamic_prop *stride, bool byte_stride_p) { - result_type = create_range_type (result_type, index_type, low_bound, - high_bound, bias); + struct type *result_type = create_range_type (alloc, index_type, low_bound, + high_bound, bias); gdb_assert (stride != nullptr); result_type->bounds ()->stride = *stride; @@ -1014,20 +1013,10 @@ create_range_type_with_stride (struct type *result_type, return result_type; } - - -/* Create a range type using either a blank type supplied in - RESULT_TYPE, or creating a new type, inheriting the objfile from - INDEX_TYPE. - - Indices will be of type INDEX_TYPE, and will range from LOW_BOUND - to HIGH_BOUND, inclusive. - - FIXME: Maybe we should check the TYPE_CODE of RESULT_TYPE to make - sure it is TYPE_CODE_UNDEF before we bash it into a range type? */ +/* See gdbtypes.h. */ struct type * -create_static_range_type (struct type *result_type, struct type *index_type, +create_static_range_type (type_allocator &alloc, struct type *index_type, LONGEST low_bound, LONGEST high_bound) { struct dynamic_prop low, high; @@ -1035,7 +1024,8 @@ create_static_range_type (struct type *result_type, struct type *index_type, low.set_const_val (low_bound); high.set_const_val (high_bound); - result_type = create_range_type (result_type, index_type, &low, &high, 0); + struct type *result_type = create_range_type (alloc, index_type, + &low, &high, 0); return result_type; } @@ -1439,12 +1429,13 @@ lookup_array_range_type (struct type *element_type, struct type *index_type; struct type *range_type; + type_allocator alloc (element_type); if (element_type->is_objfile_owned ()) index_type = objfile_type (element_type->objfile_owner ())->builtin_int; else index_type = builtin_type (element_type->arch_owner ())->builtin_int; - range_type = create_static_range_type (NULL, index_type, + range_type = create_static_range_type (alloc, index_type, low_bound, high_bound); return create_array_type (NULL, element_type, range_type); @@ -2272,8 +2263,9 @@ resolve_dynamic_range (struct type *dyn_range_type, = resolve_dynamic_type_internal (dyn_range_type->target_type (), addr_stack, 0); LONGEST bias = dyn_range_type->bounds ()->bias; + type_allocator alloc (dyn_range_type); static_range_type = create_range_type_with_stride - (copy_type (dyn_range_type), static_target_type, + (alloc, static_target_type, &low_bound, &high_bound, bias, &stride, byte_stride_p); static_range_type->bounds ()->flag_bound_evaluated = 1; return static_range_type; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index dd9d59d5ae8..83fbfdbcee0 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -2470,7 +2470,12 @@ extern struct type *lookup_function_type_with_arguments (struct type *, int, struct type **); -extern struct type *create_static_range_type (struct type *, struct type *, +/* Create a range type using ALLOC. + + Indices will be of type INDEX_TYPE, and will range from LOW_BOUND + to HIGH_BOUND, inclusive. */ + +extern struct type *create_static_range_type (type_allocator &, struct type *, LONGEST, LONGEST); @@ -2478,7 +2483,7 @@ extern struct type *create_array_type_with_stride (struct type *, struct type *, struct type *, struct dynamic_prop *, unsigned int); -extern struct type *create_range_type (struct type *, struct type *, +extern struct type *create_range_type (type_allocator &, struct type *, const struct dynamic_prop *, const struct dynamic_prop *, LONGEST); @@ -2487,8 +2492,8 @@ extern struct type *create_range_type (struct type *, struct type *, is true the value in STRIDE is a byte stride, otherwise STRIDE is a bit stride. */ -extern struct type * create_range_type_with_stride - (struct type *result_type, struct type *index_type, +extern struct type *create_range_type_with_stride + (type_allocator &alloc, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, LONGEST bias, const struct dynamic_prop *stride, bool byte_stride_p); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index c1ba0d31b00..3c299d739fe 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1862,9 +1862,12 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, ax++; rf = AUX_GET_WIDTH (bigend, ax); /* bit size of array element */ - range = create_static_range_type (NULL, indx, lower, upper); + { + type_allocator alloc (indx); + range = create_static_range_type (alloc, indx, lower, upper); - t = create_array_type (NULL, *tpp, range); + t = create_array_type (NULL, *tpp, range); + } /* We used to fill in the supplied array element bitsize here if the TYPE_LENGTH of the target type was zero. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 7ed0ebf9b1c..1e96102dfe4 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -877,8 +877,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, /* NULL terminate the string. */ string_local[ind] = 0; + type_allocator alloc (objfile); range_type - = create_static_range_type (NULL, + = create_static_range_type (alloc, objfile_type (objfile)->builtin_int, 0, ind); sym->set_type @@ -3547,8 +3548,9 @@ read_array_type (const char **pp, struct type *type, upper = -1; } + type_allocator alloc (objfile); range_type = - create_static_range_type (NULL, index_type, lower, upper); + create_static_range_type (alloc, index_type, lower, upper); type = create_array_type (type, element_type, range_type); return type; @@ -4180,7 +4182,7 @@ read_range_type (const char **pp, int typenums[2], int type_size, } result_type - = create_static_range_type (NULL, index_type, n2, n3); + = create_static_range_type (alloc, index_type, n2, n3); return (result_type); } diff --git a/gdb/valops.c b/gdb/valops.c index 3a1b14c3d44..6fb393fc2ac 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -490,7 +490,8 @@ value_cast (struct type *type, struct value *arg2) "divide object size in cast")); /* FIXME-type-allocation: need a way to free this type when we are done with it. */ - range_type = create_static_range_type (NULL, + type_allocator alloc (range_type->target_type ()); + range_type = create_static_range_type (alloc, range_type->target_type (), low_bound, new_length + low_bound - 1); @@ -4062,7 +4063,8 @@ value_slice (struct value *array, int lowbound, int length) /* FIXME-type-allocation: need a way to free this type when we are done with it. */ - slice_range_type = create_static_range_type (NULL, + type_allocator alloc (range_type->target_type ()); + slice_range_type = create_static_range_type (alloc, range_type->target_type (), lowbound, lowbound + length - 1); -- 2.39.1