public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [patch] explicit_bzero constraint on the destination buffer
@ 2018-06-28 16:05 David CARLIER
  2018-06-28 17:16 ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: David CARLIER @ 2018-06-28 16:05 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Hi,

This is my first message but here a little patch proposal for
explicit_bzero function.

Hope it s good.

Thanks.

Kind regards.

[-- Attachment #2: 0001-Constraint-on-the-destination-buffer.patch --]
[-- Type: application/octet-stream, Size: 657 bytes --]

From d70ed2be70551e962a5ae3f76197012bda9bcd27 Mon Sep 17 00:00:00 2001
From: David Carlier <dcarlier@afilias.info>
Date: Thu, 28 Jun 2018 15:39:59 +0000
Subject: [PATCH] Constraint on the destination buffer

---
 string/explicit_bzero.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/string/explicit_bzero.c b/string/explicit_bzero.c
index 7ba3f0f62c..c26ac38311 100644
--- a/string/explicit_bzero.c
+++ b/string/explicit_bzero.c
@@ -34,5 +34,5 @@ explicit_bzero (void *s, size_t len)
 {
   memset (s, '\0', len);
   /* Compiler barrier.  */
-  asm volatile ("" ::: "memory");
+  asm volatile ("" :: "r"(s)  : "memory");
 }
-- 
2.14.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-28 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28 16:05 [patch] explicit_bzero constraint on the destination buffer David CARLIER
2018-06-28 17:16 ` Adhemerval Zanella
2018-06-28 18:38   ` David CARLIER
2018-06-28 19:00     ` Adhemerval Zanella

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).