@@ -229,10 +229,10 @@ threads_table_mark_keyvalue(st_data_t key, st_data_t value, st_data_t tbl)
229
229
}
230
230
rb_gc_mark ((VALUE )value );
231
231
if (is_living_thread (thread )) {
232
- rb_gc_mark (thread );
232
+ rb_gc_mark (thread );
233
233
}
234
234
else {
235
- st_insert ((st_table * )tbl , key , 0 );
235
+ st_insert ((st_table * )tbl , key , 0 );
236
236
}
237
237
return ST_CONTINUE ;
238
238
}
@@ -431,7 +431,7 @@ thread_context_lookup(VALUE thread, VALUE *context, debug_context_t **debug_cont
431
431
}
432
432
thread_id = ref2id (thread );
433
433
Data_Get_Struct (rdebug_threads_tbl , threads_table_t , threads_table );
434
- if (!st_lookup (threads_table -> tbl , thread_id , context ))
434
+ if (!st_lookup (threads_table -> tbl , thread_id , context ) || ! * context )
435
435
{
436
436
if (create )
437
437
{
@@ -1213,10 +1213,14 @@ debug_stop(VALUE self)
1213
1213
}
1214
1214
1215
1215
static int
1216
- find_last_context_func (VALUE key , VALUE value , VALUE * result )
1216
+ find_last_context_func (st_data_t key , st_data_t value , st_data_t result_arg )
1217
1217
{
1218
1218
debug_context_t * debug_context ;
1219
- Data_Get_Struct (value , debug_context_t , debug_context );
1219
+ VALUE * result = (VALUE * )result_arg ;
1220
+ if (!value ) {
1221
+ return ST_CONTINUE ;
1222
+ }
1223
+ Data_Get_Struct ((VALUE )value , debug_context_t , debug_context );
1220
1224
if (debug_context -> thnum == last_debugged_thnum )
1221
1225
{
1222
1226
* result = value ;
0 commit comments