@@ -674,13 +674,6 @@ DSliceValue *DtoNewDynArray(Loc &loc, Type *arrayType, DValue *dim,
674674  IF_LOG Logger::println (" DtoNewDynArray : %s" toChars ());
675675  LOG_SCOPE;
676676
677-   //  typeinfo arg
678-   LLValue *arrayTypeInfo = DtoTypeInfoOf (arrayType);
679- 
680-   //  dim arg
681-   assert (DtoType (dim->type ) == DtoSize_t ());
682-   LLValue *arrayLen = DtoRVal (dim);
683- 
684677  //  get runtime function
685678  Type *eltType = arrayType->toBasetype ()->nextOf ();
686679  bool  zeroInit = eltType->isZeroInit ();
@@ -690,6 +683,13 @@ DSliceValue *DtoNewDynArray(Loc &loc, Type *arrayType, DValue *dim,
690683                           : " _d_newarrayU" 
691684  LLFunction *fn = getRuntimeFunction (loc, gIR ->module , fnname);
692685
686+   //  typeinfo arg
687+   LLValue *arrayTypeInfo = DtoTypeInfoOf (arrayType);
688+ 
689+   //  dim arg
690+   assert (DtoType (dim->type ) == DtoSize_t ());
691+   LLValue *arrayLen = DtoRVal (dim);
692+ 
693693  //  call allocator
694694  LLValue *newArray =
695695      gIR ->CreateCallOrInvoke (fn, arrayTypeInfo, arrayLen, " .gc_mem" 
@@ -704,9 +704,6 @@ DSliceValue *DtoNewMulDimDynArray(Loc &loc, Type *arrayType, DValue **dims,
704704  IF_LOG Logger::println (" DtoNewMulDimDynArray : %s" toChars ());
705705  LOG_SCOPE;
706706
707-   //  typeinfo arg
708-   LLValue *arrayTypeInfo = DtoTypeInfoOf (arrayType);
709- 
710707  //  get value type
711708  Type *vtype = arrayType->toBasetype ();
712709  for  (size_t  i = 0 ; i < ndims; ++i) {
@@ -718,6 +715,9 @@ DSliceValue *DtoNewMulDimDynArray(Loc &loc, Type *arrayType, DValue **dims,
718715      vtype->isZeroInit () ? " _d_newarraymTX" " _d_newarraymiTX" 
719716  LLFunction *fn = getRuntimeFunction (loc, gIR ->module , fnname);
720717
718+   //  typeinfo arg
719+   LLValue *arrayTypeInfo = DtoTypeInfoOf (arrayType);
720+ 
721721  //  Check if constant
722722  bool  allDimsConst = true ;
723723  for  (size_t  i = 0 ; i < ndims; ++i) {
0 commit comments