Commits

Mark Shannon committed ba90fa0 Draft

Off by one error

  • Participants
  • Parent commits 5c3ff2d

Comments (0)

Files changed (1)

File Python/trace_D_O_C.c

     HotPy_DOC* opt = (HotPy_DOC *)x;
     PyObject *bottom = opt->top_frame->stack_base[0];
     assert(STACK_DEPTH() == opt->top_frame->stack_limit);
-    for (i = 0; i < opt->top_frame->stack_limit; i++)
-        opt->top_frame->stack_base[i] = opt->top_frame->stack_base[i+1];
+    for (i = 1; i < opt->top_frame->stack_limit; i++)
+        opt->top_frame->stack_base[i-1] = opt->top_frame->stack_base[i];
     --opt->top_frame->stack_pointer;
     if (bottom == REAL_VALUE)
         Py_DECREF(REAL_VALUE);