Skip to content

Commit 850601a

Browse files
committed
add empty check
1 parent 5820ce8 commit 850601a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Python/codegen.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,9 @@ codegen_process_deferred_annotations(compiler *c, location loc)
825825
void *key = (void *)((uintptr_t)ste->ste_id + 1);
826826

827827
// Get the first annotation location
828+
if (PyList_GET_SIZE(deferred_anno) == 0) {
829+
goto error;
830+
}
828831
PyObject* ptr = PyList_GET_ITEM(deferred_anno, 0);
829832
stmt_ty st = (stmt_ty)PyLong_AsVoidPtr(ptr);
830833
if (st == NULL) {

0 commit comments

Comments
 (0)