Skip to content
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

gh-94808: _PyLineTable_StartsLine was not used #96609

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Changes from all commits
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
27 changes: 0 additions & 27 deletions Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,33 +1011,6 @@ _PyLineTable_NextAddressRange(PyCodeAddressRange *range)
return 1;
}

int
_PyLineTable_StartsLine(PyCodeAddressRange *range)
{
if (range->ar_start <= 0) {
return 0;
}
const uint8_t *ptr = range->opaque.lo_next;
do {
ptr--;
} while (((*ptr) & 128) == 0);
int code = ((*ptr)>> 3) & 15;
switch(code) {
case PY_CODE_LOCATION_INFO_LONG:
return 0;
case PY_CODE_LOCATION_INFO_NO_COLUMNS:
case PY_CODE_LOCATION_INFO_NONE:
return ptr[1] != 0;
case PY_CODE_LOCATION_INFO_ONE_LINE0:
return 0;
case PY_CODE_LOCATION_INFO_ONE_LINE1:
case PY_CODE_LOCATION_INFO_ONE_LINE2:
return 1;
default:
return 0;
}
}

static int
emit_pair(PyObject **bytes, int *offset, int a, int b)
{
Expand Down