libunwind/libunwind-1.0.1-memset.diff

113 lines
3.2 KiB
Diff
Raw Normal View History

From f89fb17695e8137a5f4e23570bf9f53374186c96 Mon Sep 17 00:00:00 2001
From: Arun <asharma@fb.com>
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 <ppluzhnikov@google.com>
---
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 ba7bf17..151ba0f 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 7aa6f31..1b21919 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 7bc2b19..49bdaba 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 dbccea8..262e23e 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 6e6f9dc..e8cc79e 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 db81db3..20b14a5 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 9e039c6..e8915fb 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;
}
--
1.7.2.5