summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2023-05-16 10:29:00 -0600
committerGitHub <noreply@github.com>2023-05-16 10:29:00 -0600
commitf40890b124a330b589c8093127be1274e15dbd7f (patch)
treea6a68ed80a4103ff60b33375c17e4fa1dc40bc6d /Python/compile.c
parentfebcc6ccfb0726dab588e64b68d91abb37db1939 (diff)
downloadcpython-git-f40890b124a330b589c8093127be1274e15dbd7f.tar.gz
gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7adbf92089..60c845a821 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4846,6 +4846,8 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e)
int opcode = asdl_seq_LEN(meth->v.Attribute.value->v.Call.args) ?
LOAD_SUPER_METHOD : LOAD_ZERO_SUPER_METHOD;
ADDOP_NAME(c, loc, opcode, meth->v.Attribute.attr, names);
+ loc = update_start_location_to_match_attr(c, loc, meth);
+ ADDOP(c, loc, NOP);
} else {
VISIT(c, expr, meth->v.Attribute.value);
loc = update_start_location_to_match_attr(c, loc, meth);
@@ -6079,6 +6081,8 @@ compiler_visit_expr1(struct compiler *c, expr_ty e)
int opcode = asdl_seq_LEN(e->v.Attribute.value->v.Call.args) ?
LOAD_SUPER_ATTR : LOAD_ZERO_SUPER_ATTR;
ADDOP_NAME(c, loc, opcode, e->v.Attribute.attr, names);
+ loc = update_start_location_to_match_attr(c, loc, e);
+ ADDOP(c, loc, NOP);
return SUCCESS;
}
VISIT(c, expr, e->v.Attribute.value);