From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11765 invoked by alias); 21 Oct 2013 14:40:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 11648 invoked by uid 89); 21 Oct 2013 14:40:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 14:40:39 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 21 Oct 2013 07:40:37 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 21 Oct 2013 07:40:36 -0700 Received: from ulliclel001.iul.intel.com (ulliclel001.iul.intel.com [172.28.50.199]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id r9LEeZrf030727 for ; Mon, 21 Oct 2013 15:40:36 +0100 Received: from ulliclel001.iul.intel.com (localhost [127.0.0.1]) by ulliclel001.iul.intel.com (8.14.4/8.12.8/MailSET/client) with ESMTP id r9LEeZ6V021128 for ; Mon, 21 Oct 2013 16:40:35 +0200 Received: (from sagovic@localhost) by ulliclel001.iul.intel.com (8.14.4/8.12.8/MailSET/Submit) id r9LEeYHK021127 for gdb-patches@sourceware.org; Mon, 21 Oct 2013 16:40:34 +0200 From: Sanimir Agovic To: gdb-patches@sourceware.org Subject: [PATCH 06/10] vla: update type from newly created value Date: Mon, 21 Oct 2013 14:40:00 -0000 Message-Id: <1382366424-21010-7-git-send-email-sanimir.agovic@intel.com> In-Reply-To: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> References: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00629.txt.bz2 Constructing a value based on a type and address might change the type of the newly constructed value. Thus re-fetch type via value_type to ensure we have the correct type at hand. 2013-10-18 Sanimir Agovic Keven Boell * valops.c (value_ind): Re-fetch type from value. * value.c (coerce_ref): Re-fetch type from value. Change-Id: Ice9ae63215f637c4b99babf0f108e7b5b58988cd --- gdb/valops.c | 1 + gdb/value.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gdb/valops.c b/gdb/valops.c index 15fd7c3..6706d9f 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1610,6 +1610,7 @@ value_ind (struct value *arg1) (value_as_address (arg1) - value_pointed_to_offset (arg1))); + enc_type = value_type (arg2); return readjust_indirect_value_type (arg2, enc_type, base_type, arg1); } diff --git a/gdb/value.c b/gdb/value.c index b9266db..ce778ea 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3360,6 +3360,7 @@ coerce_ref (struct value *arg) retval = value_at_lazy (enc_type, unpack_pointer (value_type (arg), value_contents (arg))); + enc_type = value_type (retval); return readjust_indirect_value_type (retval, enc_type, value_type_arg_tmp, arg); } -- 1.7.0.7