mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py: Allow bytecode/native to put iter_buf on stack for simple for loops.
So that the "for x in it: ..." statement can now work without using the heap (so long as the iterator argument fits in an iter_buf structure).
This commit is contained in:
@@ -387,6 +387,10 @@ const byte *mp_bytecode_print_str(const byte *ip) {
|
||||
printf("GET_ITER");
|
||||
break;
|
||||
|
||||
case MP_BC_GET_ITER_STACK:
|
||||
printf("GET_ITER_STACK");
|
||||
break;
|
||||
|
||||
case MP_BC_FOR_ITER:
|
||||
DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward
|
||||
printf("FOR_ITER " UINT_FMT, (mp_uint_t)(ip + unum - mp_showbc_code_start));
|
||||
|
||||
Reference in New Issue
Block a user