mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625)
compiler_call() needs to check if an error occurred during the maybe_optimize_method_call() call.
This commit is contained in:
parent
93e8012f2c
commit
97f5de01ad
1 changed files with 5 additions and 2 deletions
|
@ -3879,6 +3879,7 @@ check_index(struct compiler *c, expr_ty e, slice_ty s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return 1 if the method call was optimized, -1 if not, and 0 on error.
|
||||||
static int
|
static int
|
||||||
maybe_optimize_method_call(struct compiler *c, expr_ty e)
|
maybe_optimize_method_call(struct compiler *c, expr_ty e)
|
||||||
{
|
{
|
||||||
|
@ -3912,8 +3913,10 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e)
|
||||||
static int
|
static int
|
||||||
compiler_call(struct compiler *c, expr_ty e)
|
compiler_call(struct compiler *c, expr_ty e)
|
||||||
{
|
{
|
||||||
if (maybe_optimize_method_call(c, e) > 0)
|
int ret = maybe_optimize_method_call(c, e);
|
||||||
return 1;
|
if (ret >= 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
if (!check_caller(c, e->v.Call.func)) {
|
if (!check_caller(c, e->v.Call.func)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue