@@ -1103,15 +1103,15 @@ b32 potentially_convert_function_to_polyproc(Context *context, AstFunction *func
11031103// structures now have a delay instantiation phase and are not forced to be completed immediately.
11041104
11051105char * build_poly_struct_name (Context * context , char * name , Type * type ) {
1106- char name_buf [256 ];
1107- fori (i , 0 , 256 ) name_buf [i ] = 0 ;
1106+ char name_buf [512 ];
1107+ fori (i , 0 , 512 ) name_buf [i ] = 0 ;
11081108
11091109
11101110 // Special case for `? T`
11111111 if (type -> kind == Type_Kind_Union
11121112 && type -> Union .constructed_from == context -> builtins .optional_type ) {
1113- strncat (name_buf , "? " , 255 );
1114- strncat (name_buf , type_get_name (context , type -> Union .poly_sln [0 ].type ), 255 );
1113+ strncat (name_buf , "? " , 511 );
1114+ strncat (name_buf , type_get_name (context , type -> Union .poly_sln [0 ].type ), 511 );
11151115
11161116 return bh_aprintf (context -> gp_alloc , "%s" , name_buf );
11171117 }
@@ -1121,17 +1121,17 @@ char* build_poly_struct_name(Context *context, char *name, Type* type) {
11211121 if (type -> kind == Type_Kind_Union ) slns = type -> Union .poly_sln ;
11221122
11231123
1124- strncat (name_buf , name , 255 );
1125- strncat (name_buf , "(" , 255 );
1124+ strncat (name_buf , name , 511 );
1125+ strncat (name_buf , "(" , 511 );
11261126 bh_arr_each (AstPolySolution , ptype , slns ) {
11271127 if (ptype != slns )
1128- strncat (name_buf , ", " , 255 );
1128+ strncat (name_buf , ", " , 511 );
11291129
11301130 // This logic will have to be other places as well.
11311131
11321132 switch (ptype -> kind ) {
11331133 case PSK_Undefined : assert (0 ); break ;
1134- case PSK_Type : strncat (name_buf , type_get_name (context , ptype -> type ), 255 ); break ;
1134+ case PSK_Type : strncat (name_buf , type_get_name (context , ptype -> type ), 511 ); break ;
11351135 case PSK_Value : {
11361136 // FIX
11371137 AstNode * value = strip_aliases ((AstNode * ) ptype -> value );
@@ -1155,7 +1155,7 @@ char* build_poly_struct_name(Context *context, char *name, Type* type) {
11551155 }
11561156 }
11571157 }
1158- strncat (name_buf , ")" , 255 );
1158+ strncat (name_buf , ")" , 511 );
11591159
11601160 return bh_aprintf (context -> gp_alloc , "%s" , name_buf );
11611161}
0 commit comments