Skip to content

Commit 0974ec9

Browse files
committed
Fix the crashes
1 parent 101955f commit 0974ec9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Python/optimizer_analysis.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,7 @@ optimize_uops(
523523

524524
}
525525

526-
const uint16_t op_without_pop[MAX_UOP_ID] = {
527-
[_POP_TOP] = _NOP,
528-
[_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE,
529-
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW,
530-
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
531-
};
532-
533-
const uint16_t op_without_push[MAX_UOP_ID] = {
526+
const uint16_t op_without_push[MAX_UOP_ID + 1] = {
534527
[_COPY] = _NOP,
535528
[_LOAD_CONST_INLINE] = _NOP,
536529
[_LOAD_CONST_INLINE_BORROW] = _NOP,
@@ -542,6 +535,13 @@ const uint16_t op_without_push[MAX_UOP_ID] = {
542535
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO,
543536
};
544537

538+
const uint16_t op_without_pop[MAX_UOP_ID + 1] = {
539+
[_POP_TOP] = _NOP,
540+
[_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE,
541+
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW,
542+
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
543+
};
544+
545545

546546
static int
547547
remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)

Python/optimizer_symbols.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ _Py_uop_sym_set_const(JitOptContext *ctx, JitOptSymbol *sym, PyObject *const_val
284284
PyObject *item = PyTuple_GET_ITEM(const_val, i);
285285
_Py_uop_sym_set_const(ctx, sym_item, item);
286286
}
287-
_Py_uop_sym_set_const(ctx, sym, const_val);
287+
make_const(sym, const_val);
288288
return;
289289
}
290290
}

0 commit comments

Comments
 (0)