Issue24687
Created on 2015-07-22 22:09 by yselivanov, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| compile.patch | yselivanov, 2015-07-22 22:09 | review | ||
| compile2.patch | yselivanov, 2015-07-23 06:05 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg247153 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-07-22 22:09 | |
A simple way of reproducing the issue is to try to compile the following piece of code with refleaks check mode on: def foo(a:(yield)): pass Since '(yield)' expression is outside of a function, it will trigger a SyntaxError. There is a subtle bug in compile.c though, specifically in compiler_visit_argannotation method; it should return -1 in case of error, but the VISIT macro it uses returns 0 on errors. Attached patch uses 'compiler_visit_expr' directly returning correct error code. |
|||
| msg247164 - (view) | Author: Benjamin Peterson (benjamin.peterson) * | Date: 2015-07-23 04:03 | |
I would prefer that compiler_visit_argannotation[s] be fixed to use the normal calling convention. |
|||
| msg247171 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-07-23 06:05 | |
> I would prefer that compiler_visit_argannotation[s] be fixed to use the normal calling convention. Agree, new patch attached. |
|||
| msg247172 - (view) | Author: Benjamin Peterson (benjamin.peterson) * | Date: 2015-07-23 06:08 | |
Seems fine to me. |
|||
| msg247173 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-07-23 06:14 | |
New changeset b5a7f529b4ac by Yury Selivanov in branch '3.5': Issue #24687: Plug refleak on SyntaxError in function parameters annotations. https://hg.python.org/cpython/rev/b5a7f529b4ac New changeset cf91ae981afd by Yury Selivanov in branch 'default': Merge 3.5 (Issue #24687) https://hg.python.org/cpython/rev/cf91ae981afd |
|||
| msg247174 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-07-23 06:15 | |
Thanks, Benjamin! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:19 | admin | set | github: 68875 |
| 2015-07-23 06:15:17 | yselivanov | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2015-07-23 06:15:04 | yselivanov | set | messages: + msg247174 |
| 2015-07-23 06:14:39 | python-dev | set | nosy:
+ python-dev messages: + msg247173 |
| 2015-07-23 06:08:25 | benjamin.peterson | set | messages: + msg247172 |
| 2015-07-23 06:05:54 | yselivanov | set | files:
+ compile2.patch messages: + msg247171 |
| 2015-07-23 04:03:35 | benjamin.peterson | set | messages: + msg247164 |
| 2015-07-22 22:09:17 | yselivanov | create | |