mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[TBDGen] Match TAPI's truncation behavior for dylib versions
TAPI and the linker truncate individual version components to 255 if they overflow, because the linker packs 3 version components into a 32-bit int. Make sure we use the same parsing routines as TAPI. Fixes rdar://57043178
This commit is contained in:
@@ -961,16 +961,11 @@ static bool ParseTBDGenArgs(TBDGenOptions &Opts, ArgList &Args,
|
||||
Opts.IsInstallAPI = Args.hasArg(OPT_tbd_is_installapi);
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_tbd_compatibility_version)) {
|
||||
if (auto vers = version::Version::parseVersionString(
|
||||
A->getValue(), SourceLoc(), &Diags)) {
|
||||
Opts.CompatibilityVersion = *vers;
|
||||
}
|
||||
Opts.CompatibilityVersion = A->getValue();
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_tbd_current_version)) {
|
||||
if (auto vers = version::Version::parseVersionString(
|
||||
A->getValue(), SourceLoc(), &Diags)) {
|
||||
Opts.CurrentVersion = *vers;
|
||||
}
|
||||
Opts.CurrentVersion = A->getValue();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user