File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ static int8_t jl_cachearg_offset(jl_methtable_t *mt)
112112
113113static uint_t speccache_hash (size_t idx , jl_svec_t * data )
114114{
115- jl_method_instance_t * ml = (jl_method_instance_t * )jl_svecref (data , idx );
115+ jl_method_instance_t * ml = (jl_method_instance_t * )jl_svecref (data , idx ); // This must always happen inside the lock
116116 jl_value_t * sig = ml -> specTypes ;
117117 if (jl_is_unionall (sig ))
118118 sig = jl_unwrap_unionall (sig );
@@ -121,6 +121,8 @@ static uint_t speccache_hash(size_t idx, jl_svec_t *data)
121121
122122static int speccache_eq (size_t idx , const void * ty , jl_svec_t * data , uint_t hv )
123123{
124+ if (idx >= jl_svec_len (data ))
125+ return 0 ; // We got a OOB access, probably due to a data race
124126 jl_method_instance_t * ml = (jl_method_instance_t * )jl_svecref (data , idx );
125127 jl_value_t * sig = ml -> specTypes ;
126128 if (ty == sig )
You can’t perform that action at this time.
0 commit comments