Skip to content

Commit 7ae93c9

Browse files
committed
Add Win64 -preview=in special case: by-value slices and delegates
1 parent 46688ab commit 7ae93c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dmd/target.d

+7
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,13 @@ extern (C++) struct Target
790790
{
791791
if (global.params.isWindows)
792792
{
793+
// Win64 special case: by-value for slices and delegates due to
794+
// high number of usages in druntime/Phobos (compiled without
795+
// -preview=in but supposed to link against -preview=in code)
796+
const ty = t.toBasetype().ty;
797+
if (ty == Tarray || ty == Tdelegate)
798+
return false;
799+
793800
// If size is larger than 8 or not a power-of-2, the Win64 ABI
794801
// would require a hidden reference anyway.
795802
return size > 8

0 commit comments

Comments
 (0)