Skip to content

Commit 8c56a80

Browse files
authored
Merge pull request #21279 from a7ehuo/v0.51.0-windows-cfg-detection-4
(0.51) Check Control Flow Guard on Windows
2 parents 26449cd + 787f23c commit 8c56a80

File tree

4 files changed

+220
-175
lines changed

4 files changed

+220
-175
lines changed

runtime/compiler/control/J9Options.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,13 @@ bool J9::Options::feLatePostProcess(void * base, TR::OptionSet * optionSet)
32803280
vm->initializeHasResumableTrapHandler();
32813281
}
32823282

3283-
// The trap handler currently is working (jitt fails) on Ottawa's IA32 Hardhat machine.
3283+
// If Control Flow Guard (CFG) is enabled in Windows, set TR_NoResumableTrapHandler.
3284+
if (J9_ARE_ANY_BITS_SET(javaVM->sigFlags, J9_SIG_WINDOWS_MITIGATION_POLICY_CFG_ENABLED))
3285+
{
3286+
self()->setOption(TR_NoResumableTrapHandler);
3287+
}
3288+
3289+
// The trap handler currently is working (jit fails) on Ottawa's IA32 Hardhat machine.
32843290
// The platform isn't shipping so the priority of fixing the problem is currently low.
32853291
//
32863292
#if defined(HARDHAT) && defined(TR_TARGET_X86)

0 commit comments

Comments
 (0)