[issue27301] Incorrect return codes in compile.c

Serhiy Storchaka report at bugs.python.org
Sun Jun 12 11:34:08 EDT 2016


New submission from Serhiy Storchaka:

Macros ADDOP, ADDOP_I, ADDOP_O, etc are used in Python/compile.c for emitting instructions. They make functions where they are used returning 0 on error. But some functions return -1 on error and non-negative integer on success. 0 is legitimate value. In case of error in the ADDOP* macro, the error is not correctly detected in the outer function.

Here is a patch that fixes this issue in 3.6. 3.5 and 2.7 need different patches.

----------
assignee: serhiy.storchaka
components: Interpreter Core
messages: 268390
nosy: Demur Rumed, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Incorrect return codes in compile.c
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27301>
_______________________________________


More information about the Python-bugs-list mailing list