@@ -2276,7 +2276,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
|
2276 | 2276 | c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs); |
2277 | 2277 | c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs); |
2278 | 2278 | for (i = docstring ? 1 : 0; i < asdl_seq_LEN(body); i++) { |
2279 | | -VISIT(c, stmt, (stmt_ty)asdl_seq_GET(body, i)); |
| 2279 | +VISIT_IN_SCOPE(c, stmt, (stmt_ty)asdl_seq_GET(body, i)); |
2280 | 2280 | } |
2281 | 2281 | co = assemble(c, 1); |
2282 | 2282 | qualname = c->u->u_qualname; |
@@ -5533,18 +5533,24 @@ assemble_init(struct assembler *a, int nblocks, int firstlineno)
|
5533 | 5533 | { |
5534 | 5534 | memset(a, 0, sizeof(struct assembler)); |
5535 | 5535 | a->a_prevlineno = a->a_lineno = firstlineno; |
| 5536 | +a->a_lnotab = NULL; |
5536 | 5537 | a->a_bytecode = PyBytes_FromStringAndSize(NULL, DEFAULT_CODE_SIZE); |
5537 | | -if (!a->a_bytecode) |
5538 | | -return 0; |
| 5538 | +if (a->a_bytecode == NULL) { |
| 5539 | + goto error; |
| 5540 | + } |
5539 | 5541 | a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE); |
5540 | | -if (!a->a_lnotab) |
5541 | | -return 0; |
| 5542 | +if (a->a_lnotab == NULL) { |
| 5543 | + goto error; |
| 5544 | + } |
5542 | 5545 | if ((size_t)nblocks > SIZE_MAX / sizeof(basicblock *)) { |
5543 | 5546 | PyErr_NoMemory(); |
5544 | | -return 0; |
| 5547 | +goto error; |
5545 | 5548 | } |
5546 | | - |
5547 | 5549 | return 1; |
| 5550 | +error: |
| 5551 | +Py_XDECREF(a->a_bytecode); |
| 5552 | +Py_XDECREF(a->a_lnotab); |
| 5553 | +return 0; |
5548 | 5554 | } |
5549 | 5555 | |
5550 | 5556 | static void |
|