From f89fb17695e8137a5f4e23570bf9f53374186c96 Mon Sep 17 00:00:00 2001 From: Arun Date: Sun, 2 Oct 2011 22:43:28 -0700 Subject: [PATCH] Fix incorrect calls to memset. Found when compiling libunwind with clang. Signed-off-by: Paul Pluzhnikov --- src/arm/Gget_save_loc.c | 2 +- src/hppa/Gget_save_loc.c | 2 +- src/ia64/Gget_save_loc.c | 2 +- src/mips/Gget_save_loc.c | 2 +- src/x86/Gget_save_loc.c | 2 +- src/x86_64/Gget_save_loc.c | 2 +- tests/test-proc-info.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/arm/Gget_save_loc.c b/src/arm/Gget_save_loc.c index ba7bf17b..151ba0f9 100644 --- a/src/arm/Gget_save_loc.c +++ b/src/arm/Gget_save_loc.c @@ -57,7 +57,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) break; } - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (DWARF_IS_NULL_LOC (loc)) { diff --git a/src/hppa/Gget_save_loc.c b/src/hppa/Gget_save_loc.c index 7aa6f311..1b219191 100644 --- a/src/hppa/Gget_save_loc.c +++ b/src/hppa/Gget_save_loc.c @@ -35,7 +35,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) #warning FIX ME! - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (DWARF_IS_NULL_LOC (loc)) { diff --git a/src/ia64/Gget_save_loc.c b/src/ia64/Gget_save_loc.c index 7bc2b19d..49bdaba1 100644 --- a/src/ia64/Gget_save_loc.c +++ b/src/ia64/Gget_save_loc.c @@ -142,7 +142,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) break; } - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (IA64_IS_NULL_LOC (loc)) { diff --git a/src/mips/Gget_save_loc.c b/src/mips/Gget_save_loc.c index dbccea88..262e23ec 100644 --- a/src/mips/Gget_save_loc.c +++ b/src/mips/Gget_save_loc.c @@ -75,7 +75,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) break; } - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (DWARF_IS_NULL_LOC (loc)) { diff --git a/src/x86/Gget_save_loc.c b/src/x86/Gget_save_loc.c index 6e6f9dca..e8cc79ee 100644 --- a/src/x86/Gget_save_loc.c +++ b/src/x86/Gget_save_loc.c @@ -109,7 +109,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) break; } - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (DWARF_IS_NULL_LOC (loc)) { diff --git a/src/x86_64/Gget_save_loc.c b/src/x86_64/Gget_save_loc.c index db81db3a..20b14a5b 100644 --- a/src/x86_64/Gget_save_loc.c +++ b/src/x86_64/Gget_save_loc.c @@ -49,7 +49,7 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) break; } - memset (sloc, 0, sizeof (sloc)); + memset (sloc, 0, sizeof (*sloc)); if (DWARF_IS_NULL_LOC (loc)) { diff --git a/tests/test-proc-info.c b/tests/test-proc-info.c index 9e039c6f..e8915fb3 100644 --- a/tests/test-proc-info.c +++ b/tests/test-proc-info.c @@ -72,7 +72,7 @@ access_fpreg (unw_addr_space_t as, unw_regnum_t regnum, unw_fpreg_t *valp, int write, void *arg) { if (!write) - memset (valp, 0, sizeof (valp)); + memset (valp, 0, sizeof (*valp)); return 0; }