public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-jankratochvil-vla: Fix the excessive memory reading: http://sourceware.org/bugzilla/show_bug.cgi?id=9395#c7 - Bugreported by Joachim Protze.
@ 2011-02-25 18:09 jkratoch
0 siblings, 0 replies; only message in thread
From: jkratoch @ 2011-02-25 18:09 UTC (permalink / raw)
To: archer-commits
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-25 18:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 18:09 [SCM] archer-jankratochvil-vla: Fix the excessive memory reading: http://sourceware.org/bugzilla/show_bug.cgi?id=9395#c7 - Bugreported by Joachim Protze jkratoch
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).