Skip to content

Commit c5de0c1

Browse files
authored
[Win] Enable control flow guard compiler option (flutter#638)
Enables the /guard:cf flag in the MSVC compile options. This causes the compiler to analyze control flow for indirect call targets at compile time, and insert checks to verify the targets at runtime. This flag is a requirement for Google apps. Issue: flutter#113119
1 parent 4acdbf8 commit c5de0c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build/config/compiler/BUILD.gn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ config("compiler") {
7676
# Windows compiler flags setup.
7777
# -----------------------------
7878
cflags += [
79-
"/GS", # Enable buffer security checking.
80-
"/FS", # Preserve previous PDB behavior.
79+
"/GS", # Enable buffer security checking.
80+
"/FS", # Preserve previous PDB behavior.
81+
"/guard:cf", # Enable control flow guard security checks.
8182
]
8283
} else {
8384
# Common GCC compiler flags setup.

0 commit comments

Comments
 (0)