8000 gh-93678: add _testinternalcapi.optimize_cfg() and test utils for compiler optimization unit tests by iritkatriel · Pull Request #96007 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-93678: add _testinternalcapi.optimize_cfg() and test utils for compiler optimization unit tests #96007

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 11 commits into from
Aug 24, 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
long long --> uintptr_t, and added a comment clarifying that the poin…
…ter is used as a unique ID
  • Loading branch information
iritkatriel committed Aug 23, 2022
commit 2818fd3d13f363596abbff50ef2223ca8fb2cde9
5 changes: 3 additions & 2 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -9704,9 +9704,10 @@ cfg_to_instructions(cfg_builder *g)
for (int i = 0; i < b->b_iused; i++) {
struct instr *instr = &b->b_instr[i];
struct location loc = instr->i_loc;
long long arg = instr->i_oparg;
uintptr_t arg = instr->i_oparg;
if (HAS_TARGET(instr->i_opcode)) {
arg = (long long)instr->i_target;
/* Use the address of the block as its unique ID (for the label) */
arg = (uintptr_t)instr->i_target;
}

PyObject *inst_tuple = Py_BuildValue(
Expand Down
0