[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] Support clang for explicit_bzero
From: |
roucaries . bastien |
Subject: |
[PATCH 4/6] Support clang for explicit_bzero |
Date: |
Mon, 13 Apr 2020 01:09:16 +0200 |
From: Bastien Roucariès <address@hidden>
According to https://bugs.llvm.org/show_bug.cgi?id=15495#c11
llvm need g type constraint
Signed-off-by: Bastien Roucariès <address@hidden>
---
lib/explicit_bzero.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index 489732791..bb52d11de 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -56,9 +56,13 @@ explicit_bzero (void *s, size_t len)
(void) memset_s (s, len, '\0', len);
#else
memset (s, '\0', len);
-# if defined __GNUC__ && !defined __clang__
+#if defined __GNUC__
+# if !defined __clang__
/* Compiler barrier. */
asm volatile ("" ::: "memory");
+# else
+ /* https://bugs.llvm.org/show_bug.cgi?id=15495#c11 */
+ __asm__ volatile("" : : "g"(s) : "memory");
# endif
#endif
}
--
2.25.1
- [V3][0/6] explicit_bzero, roucaries . bastien, 2020/04/12
- [PATCH 1/6] Fix test in case of canaries on heap buffer after free, roucaries . bastien, 2020/04/12
- [PATCH 2/6] Use memset_s if possible for explicit_bzero, roucaries . bastien, 2020/04/12
- [PATCH 3/6] Use SecureZeroMemory on windows for explicit_bzero, roucaries . bastien, 2020/04/12
- [PATCH 4/6] Support clang for explicit_bzero,
roucaries . bastien <=
- [PATCH 5/6] Implement fallback for explicit_bzero using jump to volatile pointer, roucaries . bastien, 2020/04/12
- [PATCH 6/6] Improve styling in explicit_bzero, roucaries . bastien, 2020/04/12