mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-91869: Fix tracing of specialized instructions with extended args (GH-91945)
This commit is contained in:
parent
407c3afe19
commit
37c6db60f9
9 changed files with 145 additions and 88 deletions
|
@ -211,13 +211,13 @@ write_instr(_Py_CODEUNIT *codestr, struct instr *instruction, int ilen)
|
|||
int caches = _PyOpcode_Caches[opcode];
|
||||
switch (ilen - caches) {
|
||||
case 4:
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 24) & 0xFF);
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG_QUICK, (oparg >> 24) & 0xFF);
|
||||
/* fall through */
|
||||
case 3:
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 16) & 0xFF);
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG_QUICK, (oparg >> 16) & 0xFF);
|
||||
/* fall through */
|
||||
case 2:
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 8) & 0xFF);
|
||||
*codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG_QUICK, (oparg >> 8) & 0xFF);
|
||||
/* fall through */
|
||||
case 1:
|
||||
*codestr++ = _Py_MAKECODEUNIT(opcode, oparg & 0xFF);
|
||||
|
@ -8254,6 +8254,7 @@ fix_cell_offsets(struct compiler *c, basicblock *entryblock, int *fixedmap)
|
|||
struct instr *inst = &b->b_instr[i];
|
||||
// This is called before extended args are generated.
|
||||
assert(inst->i_opcode != EXTENDED_ARG);
|
||||
assert(inst->i_opcode != EXTENDED_ARG_QUICK);
|
||||
int oldoffset = inst->i_oparg;
|
||||
switch(inst->i_opcode) {
|
||||
case MAKE_CELL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue