File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,19 +244,20 @@ void ThreadInfo::unwind_tasks()
244244 {
245245 auto & task = current_task.get ();
246246
247- int stack_size = task.unwind (stack);
247+ size_t stack_size = task.unwind (stack);
248248
249249 if (on_cpu)
250250 {
251251 // Undo the stack unwinding
252252 // TODO[perf]: not super-efficient :(
253- for (int i = 0 ; i < stack_size; i++)
253+ for (size_t i = 0 ; i < stack_size; i++)
254254 stack.pop_back ();
255255
256256 // Instead we get part of the thread stack
257257 FrameStack temp_stack;
258- ssize_t nframes = python_stack.size () - stack_size + 1 ;
259- for (ssize_t i = 0 ; i < nframes; i++)
258+ size_t nframes =
259+ (python_stack.size () > stack_size) ? python_stack.size () - stack_size : 0 ;
260+ for (size_t i = 0 ; i < nframes; i++)
260261 {
261262 auto python_frame = python_stack.front ();
262263 temp_stack.push_front (python_frame);
You can’t perform that action at this time.
0 commit comments