[X86] Initialize TargetOptions::StackProtectorGuardOffset member to its default value

D88631 introduced a set of knobs to tweak how the stack protector is codegen'd for x86 targets, including the offset from the base register where the stack cookie is located. The `StackProtectorGuardOffset` field in `TargetOptions` was left uninitialized instead of being reset to its neutral value -1, making it possible to emit nonsensical code if the frontend doesn't change the field value at all before feeding the `TargetOptions` to the target machine initializer.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D99952
This commit is contained in:
LemonBoy 2021-04-06 20:40:15 +02:00
parent fee330824a
commit 03f7b13d44
1 changed files with 1 additions and 1 deletions

View File

@ -332,7 +332,7 @@ namespace llvm {
unsigned XRayOmitFunctionIndex : 1;
/// Stack protector guard offset to use.
unsigned StackProtectorGuardOffset : 32;
unsigned StackProtectorGuardOffset = -1U;
/// Stack protector guard mode to use, e.g. tls, global.
StackProtectorGuards StackProtectorGuard =