[Python-checkins] gh-88057: in compile.c, assertion that stackdepth is alway >=0 is missing in one place (GH-96513)

iritkatriel webhook-mailer at python.org
Wed Sep 7 09:02:24 EDT 2022


https://github.com/python/cpython/commit/0cd992c0005a4e605fe5b588e28bf9c0468d02e7
commit: 0cd992c0005a4e605fe5b588e28bf9c0468d02e7
branch: main
author: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-09-07T14:01:57+01:00
summary:

gh-88057: in compile.c, assertion that stackdepth is alway >=0 is missing in one place (GH-96513)

files:
M Python/compile.c

diff --git a/Python/compile.c b/Python/compile.c
index 862999d87b8..33a8679fd88 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -7075,6 +7075,7 @@ stackdepth(basicblock *entryblock, int code_flags)
                 return -1;
             }
             int new_depth = depth + effect;
+            assert(new_depth >= 0); /* invalid code or bug in stackdepth() */
             if (new_depth > maxdepth) {
                 maxdepth = new_depth;
             }



More information about the Python-checkins mailing list