Skip to content

Instantly share code, notes, and snippets.

@ryuukk
Created January 13, 2025 16:57
Show Gist options
  • Save ryuukk/e04261cf0293339b43dfd9b2ad8809b5 to your computer and use it in GitHub Desktop.
Save ryuukk/e04261cf0293339b43dfd9b2ad8809b5 to your computer and use it in GitHub Desktop.
diff --git a/compiler/src/dmd/typesem.d b/compiler/src/dmd/typesem.d
index dc3f9da..c38d7e8 100644
--- a/compiler/src/dmd/typesem.d
+++ b/compiler/src/dmd/typesem.d
@@ -5906,12 +5906,12 @@ Expression defaultInit(Type mt, const ref Loc loc, const bool isCfile = false)
switch (mt.ty)
{
case Tchar:
- value = isCfile ? 0 : 0xFF;
+ value = 0;
break;
case Twchar:
case Tdchar:
- value = isCfile ? 0 : 0xFFFF;
+ value = 0;
break;
case Timaginary32:
@@ -5920,15 +5920,14 @@ Expression defaultInit(Type mt, const ref Loc loc, const bool isCfile = false)
case Tfloat32:
case Tfloat64:
case Tfloat80:
- return new RealExp(loc, isCfile ? CTFloat.zero : target.RealProperties.nan, mt);
+ return new RealExp(loc, CTFloat.zero, mt);
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
{
// Can't use fvalue + I*fvalue (the im part becomes a quiet NaN).
- const cvalue = isCfile ? complex_t(CTFloat.zero, CTFloat.zero)
- : complex_t(target.RealProperties.nan, target.RealProperties.nan);
+ const cvalue = complex_t(CTFloat.zero, CTFloat.zero);
return new ComplexExp(loc, cvalue, mt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment