Skip to content

Commit 47e3f49

Browse files
committed
[UCRT] No __declspec(spectre(nomitigation)) for GCC/Clang
1 parent 97e20ef commit 47e3f49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,10 @@ class spectre_mitigated_lookup_table
576576

577577
// Instead of using an lfence mitigation, we can fill the table to a power of two,
578578
// then bitwise-and all values used to index into the array.
579-
__declspec(spectre(nomitigation)) T const& operator[](size_t const index) const
579+
#if defined(_MSC_VER) && !defined(__clang__)
580+
__declspec(spectre(nomitigation))
581+
#endif
582+
T const& operator[](size_t const index) const
580583
{
581584
return m_array[index & mask];
582585
}

0 commit comments

Comments
 (0)