Disable optimisation depending on compiler type for victim_function in spectre_v2
This commit is contained in:
parent
ecd5fbc0bf
commit
0f0dd946cd
@ -46,7 +46,13 @@ safe_target()
|
|||||||
// function that makes indirect call
|
// function that makes indirect call
|
||||||
// note that addr will be passed to gadget via %rdi
|
// note that addr will be passed to gadget via %rdi
|
||||||
int
|
int
|
||||||
|
#if defined(__clang__)
|
||||||
|
victim_function(char* addr, int input) __attribute__ ((optnone))
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
__attribute__((optimize("O0"))) victim_function(char* addr, int input)
|
||||||
|
#else
|
||||||
victim_function(char* addr, int input)
|
victim_function(char* addr, int input)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#pragma GCC diagnostic ignored "-Wuninitialized"
|
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||||
unsigned int result, junk = junk;
|
unsigned int result, junk = junk;
|
||||||
|
Loading…
Reference in New Issue
Block a user