diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp index 17a4a4c2b..f895e9656 100644 --- a/src/support/cleanse.cpp +++ b/src/support/cleanse.cpp @@ -30,14 +30,14 @@ */ void memory_cleanse(void *ptr, size_t len) { +#if defined(_MSC_VER) + SecureZeroMemory(ptr, len); +#else std::memset(ptr, 0, len); /* As best as we can tell, this is sufficient to break any optimisations that might try to eliminate "superfluous" memsets. If there's an easy way to detect memset_s, it would be better to use that. */ -#if defined(_MSC_VER) - SecureZeroMemory(ptr, len); -#else __asm__ __volatile__("" : : "r"(ptr) : "memory"); #endif }