public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-vla: Fix the excessive memory reading:   http://sourceware.org/bugzilla/show_bug.cgi?id=9395#c7   - Bugreported by Joachim Protze.
Date: Fri, 25 Feb 2011 18:09:00 -0000	[thread overview]
Message-ID: <20110225180901.15783.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-vla has been updated
       via  530ce8bb0aeeb513f566da7a7fae46d6414f8dc1 (commit)
      from  678cbb7340d8edfa92ce6de931d8d4e9c3b86c06 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 530ce8bb0aeeb513f566da7a7fae46d6414f8dc1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Feb 25 19:08:16 2011 +0100

    Fix the excessive memory reading:
      http://sourceware.org/bugzilla/show_bug.cgi?id=9395#c7
      - Bugreported by Joachim Protze.

-----------------------------------------------------------------------

Summary of changes:
 gdb/eval.c     |   19 +++++++++++++++++--
 gdb/gdbtypes.c |    2 ++
 2 files changed, 19 insertions(+), 2 deletions(-)

First 500 lines of diff:
diff --git a/gdb/eval.c b/gdb/eval.c
index f4ccc89..e27a7aa 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -513,7 +513,7 @@ value_f90_subarray (struct value *array, struct expression *exp, int *pos,
   struct type *new_array_type;
 
   /* Type being iterated for each dimension.  */
-  struct type *type;
+  struct type *type, *type_last_target;
 
   /* Pointer in the last holder to the type of current dimension.  */
   struct type **typep = &new_array_type;
@@ -533,6 +533,7 @@ value_f90_subarray (struct value *array, struct expression *exp, int *pos,
 	};
     }
   *subscript_array;
+  struct type **type_array;
   int i;
   struct cleanup *old_chain;
   CORE_ADDR value_byte_address, value_byte_offset = 0;
@@ -678,7 +679,21 @@ value_f90_subarray (struct value *array, struct expression *exp, int *pos,
 	}
     }
 
-  check_typedef (new_array_type);
+  type_last_target = type;
+  type_array = alloca (sizeof (*type_array) * nargs);
+  i = 0;
+  for (type = new_array_type; type != type_last_target;
+       type = TYPE_TARGET_TYPE (type))
+    type_array[i++] = type;
+  while (i > 0)
+    {
+      struct type *type = type_array[--i];
+
+      /* Force TYPE_LENGTH (type) recalculation.  */
+      TYPE_TARGET_STUB (type) = 1;
+      check_typedef (type);
+    }
+
   saved_array = array;
   array = allocate_value_lazy (new_array_type);
   VALUE_LVAL (array) = VALUE_LVAL (saved_array);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index ec5ad9c..e3b9eac 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1734,6 +1734,8 @@ check_typedef (struct type *type)
       htab_delete (copied_types);
 
       gdb_assert (TYPE_DYNAMIC (type) == 0);
+      /* Force TYPE_LENGTH (type) recalculation.  */
+      TYPE_DYNAMIC (type) = 1;
     }
 
   if (TYPE_TARGET_STUB (type) || TYPE_DYNAMIC (type))


hooks/post-receive
--
Repository for Project Archer.


                 reply	other threads:[~2011-02-25 18:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110225180901.15783.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).