8000 GH-93662: Make sure that column offsets are correct in multi-line method calls. by markshannon · Pull Request #93673 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-93662: Make sure that column offsets are correct in multi-line method calls. #93673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix MSVC warnings.
  • Loading branch information
markshannon committed Jun 10, 2022
commit 86c7cf3a77d2bdbb2f9dac8c385b928b08c573fa
4 changes: 2 additions & 2 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4846,7 +4846,7 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e)
if (meth->lineno != meth->end_lineno) {
// Make start location match attribute
c->u->u_lineno = meth->end_lineno;
c->u->u_col_offset = meth->end_col_offset - PyUnicode_GetLength(meth->v.Attribute.attr)-1;
c->u->u_col_offset = meth->end_col_offset - (int)PyUnicode_GetLength(meth->v.Attribute.attr)-1;
}
ADDOP_NAME(c, LOAD_METHOD, meth->v.Attribute.attr, names);
VISIT_SEQ(c, expr, e->v.Call.args);
Expand All @@ -4861,7 +4861,7 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e)
if (meth->lineno != meth->end_lineno) {
// Make start location match attribute
c->u->u_lineno = meth->end_lineno;
c->u->u_col_offset = meth->end_col_offset - PyUnicode_GetLength(meth->v.Attribute.attr)-1;
c->u->u_col_offset = meth->end_col_offset - (int)PyUnicode_GetLength(meth->v.Attribute.attr)-1;
}
ADDOP_I(c, CALL, argsl + kwdsl);
return 1;
Expand Down
0