Message247153
| Author |
yselivanov |
| Recipients |
benjamin.peterson, ncoghlan, yselivanov |
| Date |
2015-07-22.22:09:17 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1437602957.63.0.089802664911.issue24687@psf.upfronthosting.co.za> |
| In-reply-to |
|
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015-07-22 22:09:17 | yselivanov | set | recipients:
+ yselivanov, ncoghlan, benjamin.peterson |
| 2015-07-22 22:09:17 | yselivanov | set | messageid: <1437602957.63.0.089802664911.issue24687@psf.upfronthosting.co.za> |
| 2015-07-22 22:09:17 | yselivanov | link | issue24687 messages |
| 2015-07-22 22:09:17 | yselivanov | create | |
|