Skip to content
Snippets Groups Projects
  1. Dec 08, 2017
  2. Dec 07, 2017
  3. Dec 06, 2017
  4. Dec 05, 2017
  5. Dec 04, 2017
  6. Dec 03, 2017
  7. Dec 01, 2017
  8. Nov 30, 2017
    • Paul Sokolovsky's avatar
    • Paul Carver's avatar
      docs/library/utime: Fix incorrect example with ticks_diff args order. · 7d25a192
      Paul Carver authored
      The parameter order in the example for ticks_diff was incorrect.  If it's
      "too early" that means that scheduled time is greater than current time and
      if it's "running late" then scheduled time would be less than current time.
      7d25a192
    • Damien George's avatar
      py/objgenerator: Remove unreachable code for STOP_ITERATION case. · 64f11470
      Damien George authored
      This commit essentially reverts aa9dbb1b
      where this if-condition was added.  It seems that even when that commit
      was made the code was never reached by any tests, nor reachable by
      analysis (see below).  The same is true with the code as it currently
      stands: no test triggers this if-condition, nor any uasyncio examples.
      Analysing the flow of the program also shows that it's not reachable:
      
      ==START==
      -> to trigger this if condition mp_execute_bytecode() must return
         MP_VM_RETURN_YIELD with *sp==MP_OBJ_STOP_ITERATION
      
         -> mp_execute_bytecode() can only return MP_VM_RETURN_YIELD from the
            MP_BC_YIELD_VALUE bytecode, which can happen in 2 ways:
      
            -> 1) from a "yield <x>" in bytecode, but <x> must always be a proper
               object, never MP_OBJ_STOP_ITERATION; ==END1==
      
            -> 2) via yield from, via mp_resume() which must return
               MP_VM_RETURN_YIELD with ret_value==MP_OBJ_STOP_ITERATION, which
               can happen in 3 ways:
      
               -> 1) it delegates to mp_obj_gen_resume(); go back to ==START==
      
               -> 2) it returns MP_VM_RETURN_YIELD directly but with a guard that
                  ret_val!=MP_OBJ_STOP_ITERATION; ==END2==
      
               -> 3) it returns MP_VM_RETURN_YIELD with ret_val set from
                  mp_call_method_n_kw(), but mp_call_method_n_kw() must return a
                  proper object, never MP_OBJ_STOP_ITERATION; ==END3==
      
      The above shows there is no way to trigger the if-condition and it can be
      removed.
      64f11470
  9. Nov 29, 2017
  10. Nov 28, 2017
Loading