Skip to content

Commit 771b6a4

Browse files
committed
win32: disable DEP qualifications outside of MSVC
1 parent b26adc4 commit 771b6a4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/trusted/platform_qualify/win/nacl_dep_qualify.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
int NaClAttemptToExecuteDataAtAddr(uint8_t *thunk_buffer, size_t size) {
22+
#if defined(_MSC_VER)
2223
int got_fault = 0;
2324
nacl_void_thunk thunk = NaClGenerateThunk(thunk_buffer, size);
2425
__try {
@@ -28,12 +29,16 @@ int NaClAttemptToExecuteDataAtAddr(uint8_t *thunk_buffer, size_t size) {
2829
got_fault = 1;
2930
}
3031
return got_fault;
32+
#else
33+
return 1;
34+
#endif
3135
}
3236

3337
/*
3438
* Returns 1 if Data Execution Prevention is present and working.
3539
*/
3640
int NaClAttemptToExecuteData(void) {
41+
#if defined(_MSC_VER)
3742
int result;
3843
uint8_t *thunk_buffer = malloc(64);
3944
if (NULL == thunk_buffer) {
@@ -42,4 +47,7 @@ int NaClAttemptToExecuteData(void) {
4247
result = NaClAttemptToExecuteDataAtAddr(thunk_buffer, 64);
4348
free(thunk_buffer);
4449
return result;
50+
#else
51+
return 1;
52+
#endif
4553
}

0 commit comments

Comments
 (0)