diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py --- a/Lib/test/test_list.py +++ b/Lib/test/test_list.py @@ -98,6 +98,14 @@ d = pickle.dumps(it) self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:]) + def test_no_comdat_folding(self): + # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding + # optimization causes failures in code that relies on distinct + # function addresses. + class L(list): pass + with self.assertRaises(TypeError): + (3,) + L([1,2]) + def test_main(verbose=None): support.run_unittest(ListTest) diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -193,6 +193,14 @@ d = pickle.dumps(it) self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:]) + def test_no_comdat_folding(self): + # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding + # optimization causes failures in code that relies on distinct + # function addresses. + class T(tuple): pass + with self.assertRaises(TypeError): + [3,] + T((1,2)) + def test_main(): support.run_unittest(TupleTest) diff --git a/PCbuild/pginstrument.props b/PCbuild/pginstrument.props --- a/PCbuild/pginstrument.props +++ b/PCbuild/pginstrument.props @@ -24,7 +24,7 @@ true - true + false PGInstrument $(SolutionDir)$(Platform)-pgi\$(TargetName).pgd $(OutDirPGI)\$(TargetName).lib @@ -35,4 +35,4 @@ $(OutDirPGI) - \ No newline at end of file + diff --git a/PCbuild/pylauncher.vcxproj b/PCbuild/pylauncher.vcxproj --- a/PCbuild/pylauncher.vcxproj +++ b/PCbuild/pylauncher.vcxproj @@ -199,7 +199,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -216,7 +216,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -233,7 +233,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -250,7 +250,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -267,7 +267,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -284,7 +284,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -308,4 +308,4 @@ - \ No newline at end of file + diff --git a/PCbuild/pywlauncher.vcxproj b/PCbuild/pywlauncher.vcxproj --- a/PCbuild/pywlauncher.vcxproj +++ b/PCbuild/pywlauncher.vcxproj @@ -143,7 +143,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -160,7 +160,7 @@ true - true + false true false version.lib;%(AdditionalDependencies) @@ -199,4 +199,4 @@ - \ No newline at end of file +