diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-11 20:32:39 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-11 20:51:31 +0300 |
commit | c48d6f7add021e284558c24b25e53115fe185feb (patch) | |
tree | 0884d96db1d9d031ccf68cefdfb46847c45efca1 /py/vm.c | |
parent | 0f570cfccf11b2e2fe76f3e973990896fca9b189 (diff) | |
download | micropython-c48d6f7add021e284558c24b25e53115fe185feb.tar.gz micropython-c48d6f7add021e284558c24b25e53115fe185feb.zip |
py: Don't expect that type->getiter() always returns iterator, check for NULL.
This is better than forcing each getiter() implementation to raise exception.
Diffstat (limited to 'py/vm.c')
-rw-r--r-- | py/vm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -663,6 +663,7 @@ unwind_jump: ENTRY(MP_BC_FOR_ITER): DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward save_sp = sp; + assert(TOP()); obj1 = mp_iternext_allow_raise(TOP()); if (obj1 == MP_OBJ_STOP_ITERATION) { --sp; // pop the exhausted iterator |