Visitar URL original
GH-93662: Make sure that column offsets are correct in multi-line method calls. by markshannon · Pull Request #93673 · python/cpython · GitHub
Skip to content
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;
Comment thread
markshannon marked this conversation as resolved.
Outdated
}
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