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
Add assertions
  • Loading branch information
Eclips4 committed Jan 29, 2025
commit acd2f57d5aa534b6ed41891f5d20b8fb53a065ed
6 changes: 6 additions & 0 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,12 @@ optimize_const_sequence(PyObject *const_cache,
assert(PyDict_CheckExact(const_cache));
assert(PyList_CheckExact(consts));
assert(inst[n].i_oparg == n);
if (list) {
assert(inst[n].i_opcode == BUILD_LIST)
}
else {
assert(inst[n].i_opcode == BUILD_SET)
}
Comment thread
Eclips4 marked this conversation as resolved.
Outdated
Comment thread
iritkatriel marked this conversation as resolved.
Outdated

if (n < 3 || !is_sequence_constant(inst, n)) {
Comment thread
iritkatriel marked this conversation as resolved.
Outdated
Comment thread
Eclips4 marked this conversation as resolved.
Outdated
return SUCCESS;
Expand Down