[ltrace-commits] 03/07: Do not add naked voids to DIE->arg_type_info hash
Petr Machata
pmachata-guest at moszumanska.debian.org
Fri Jan 16 19:32:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
pmachata-guest pushed a commit to branch master
in repository ltrace.
commit 6db31e662a7461c23b76c1de7a488e284d2e8613
Author: Petr Machata <pmachata at redhat.com>
Date: Fri Jan 16 18:31:56 2015 +0100
Do not add naked voids to DIE->arg_type_info hash
The reason is that these then get looked up and added as naked voids
to structures. They do get updated later, but this prevents us from
adding a simple assert to type_struct_add.
---
dwarf_prototypes.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dwarf_prototypes.c b/dwarf_prototypes.c
index 85b0278..de7d6c2 100644
--- a/dwarf_prototypes.c
+++ b/dwarf_prototypes.c
@@ -733,13 +733,28 @@ static struct arg_type_info *get_type(int *newly_allocated_result,
complain(type_die, "alloc error");
CLEANUP_AND_RETURN_ERROR(NULL);
}
+
+ /* Make it at least look like a pointer, so that
+ * e.g. alignment and sizeof can be computed when
+ * needed, and so that it doesn't look as if we're
+ * adding bare voids to structures. */
+ result->type = ARGTYPE_POINTER;
+ result->u.ptr_info.info = NULL;
+
+ /* Add it now so that recursive requests for this type
+ * don't end up spinning endlessly. */
DICT_INSERT_AND_CHECK(type_dieoffset_hash, &die_offset, &result);
+
+ /* Now we can safely recurse. */
pointee = get_type(&newly_allocated_pointee,
&next_die, plib, type_dieoffset_hash);
if (pointee == NULL)
CLEANUP_AND_RETURN_ERROR(NULL);
+ /* Update the stored type in-place. */
type_init_pointer(result, pointee, newly_allocated_pointee);
+ complain(type_die, "Done storing pointer type.");
+
return result;
case DW_TAG_structure_type:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git
More information about the ltrace-commits
mailing list