mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Disable deserialization safety along with access control
Disabling access control is fundamentally incompatible with deserialization safety. Let's turn off safety automatically when in use. This was reported by a few tests: stdlib/Dictionary.swift stdlib/Set.swift stdlib/SetOperations.swift.gyb stdlib/SwiftNativeNSBase.swift
This commit is contained in:
@@ -563,6 +563,17 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
OPT_disable_deserialization_safety)) {
|
||||
Opts.EnableDeserializationSafety
|
||||
= A->getOption().matches(OPT_enable_deserialization_safety);
|
||||
} else if (auto A = Args.getLastArg(OPT_enable_access_control,
|
||||
OPT_disable_access_control)) {
|
||||
// Disable deserialization safety along with access control.
|
||||
Opts.EnableDeserializationSafety
|
||||
= A->getOption().matches(OPT_enable_access_control);
|
||||
}
|
||||
|
||||
if (auto A = Args.getLastArg(OPT_enable_access_control,
|
||||
OPT_disable_access_control)) {
|
||||
Opts.EnableAccessControl
|
||||
= A->getOption().matches(OPT_enable_access_control);
|
||||
}
|
||||
|
||||
// Whether '/.../' regex literals are enabled. This implies experimental
|
||||
@@ -616,12 +627,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Args.hasArg(OPT_warn_on_potentially_unavailable_enum_case);
|
||||
Opts.WarnOnEditorPlaceholder |= Args.hasArg(OPT_warn_on_editor_placeholder);
|
||||
|
||||
if (auto A = Args.getLastArg(OPT_enable_access_control,
|
||||
OPT_disable_access_control)) {
|
||||
Opts.EnableAccessControl
|
||||
= A->getOption().matches(OPT_enable_access_control);
|
||||
}
|
||||
|
||||
if (auto A = Args.getLastArg(OPT_disable_typo_correction,
|
||||
OPT_typo_correction_limit)) {
|
||||
if (A->getOption().matches(OPT_disable_typo_correction))
|
||||
|
||||
Reference in New Issue
Block a user