@@ -1558,7 +1558,7 @@ static jl_lambda_info_t *jl_mt_assoc_by_type(jl_methtable_t *mt, jl_datatype_t *
1558
1558
jl_svec_t * env = jl_emptysvec ;
1559
1559
jl_method_t * func = NULL ;
1560
1560
jl_tupletype_t * sig = NULL ;
1561
- JL_GC_PUSH4 (& env , & m , & func , & tt );
1561
+ JL_GC_PUSH4 (& env , & m , & func , & sig );
1562
1562
1563
1563
m = jl_typemap_assoc_by_type (mt -> defs , tt , & env , inexact , 1 , 0 );
1564
1564
if (m == NULL ) {
@@ -1569,7 +1569,7 @@ static jl_lambda_info_t *jl_mt_assoc_by_type(jl_methtable_t *mt, jl_datatype_t *
1569
1569
sig = join_tsig (tt , m -> sig );
1570
1570
jl_lambda_info_t * nf ;
1571
1571
if (!cache )
1572
- nf = jl_get_specialized (m -> func .method , tt , env );
1572
+ nf = jl_get_specialized (m -> func .method , sig , env );
1573
1573
else
1574
1574
nf = cache_method (mt , & mt -> cache , (jl_value_t * )mt , sig , tt , m , env );
1575
1575
JL_GC_POP ();
@@ -2293,7 +2293,7 @@ jl_value_t *jl_gf_invoke(jl_tupletype_t *types0, jl_value_t **args, size_t nargs
2293
2293
jl_tupletype_t * tt = NULL ;
2294
2294
jl_tupletype_t * types = NULL ;
2295
2295
jl_tupletype_t * sig = NULL ;
2296
- JL_GC_PUSH4 (& types , & tpenv , & newsig , & sig );
2296
+ JL_GC_PUSH5 (& types , & tpenv , & newsig , & sig , & tt );
2297
2297
jl_value_t * gf = args [0 ];
2298
2298
types = (jl_datatype_t * )jl_argtype_with_function (gf , (jl_tupletype_t * )types0 );
2299
2299
jl_methtable_t * mt = jl_gf_mtable (gf );
@@ -2312,15 +2312,7 @@ jl_value_t *jl_gf_invoke(jl_tupletype_t *types0, jl_value_t **args, size_t nargs
2312
2312
mfunc = NULL ;
2313
2313
else
2314
2314
mfunc = jl_typemap_assoc_exact (m -> func .method -> invokes , args , nargs , jl_cachearg_offset (mt ));
2315
- if (mfunc != NULL ) {
2316
- if (mfunc -> inInference || mfunc -> inCompile ) {
2317
- // if inference is running on this function, return a copy
2318
- // of the function to be compiled without inference and run.
2319
- JL_GC_POP ();
2320
- return jl_call_unspecialized (mfunc -> sparam_vals , jl_get_unspecialized (mfunc ), args , nargs );
2321
- }
2322
- }
2323
- else {
2315
+ if (mfunc == NULL ) {
2324
2316
tt = arg_type_tuple (args , nargs );
2325
2317
if (m -> tvars != jl_emptysvec ) {
2326
2318
jl_value_t * ti =
@@ -2336,8 +2328,12 @@ jl_value_t *jl_gf_invoke(jl_tupletype_t *types0, jl_value_t **args, size_t nargs
2336
2328
2337
2329
mfunc = cache_method (mt , & m -> func .method -> invokes , m -> func .value , sig , tt , m , tpenv );
2338
2330
}
2339
-
2340
2331
JL_GC_POP ();
2332
+ if (mfunc -> inInference || mfunc -> inCompile ) {
2333
+ // if inference is running on this function, return a copy
2334
+ // of the function to be compiled without inference and run.
2335
+ return jl_call_unspecialized (mfunc -> sparam_vals , jl_get_unspecialized (mfunc ), args , nargs );
2336
+ }
2341
2337
return jl_call_method_internal (mfunc , args , nargs );
2342
2338
}
2343
2339
0 commit comments