@@ -222,60 +222,15 @@ dummy_func(void) {
222222 }
223223
224224 op (_BINARY_OP_ADD_INT , (left , right -- res )) {
225- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
226- assert (PyLong_CheckExact (sym_get_const (ctx , left )));
227- assert (PyLong_CheckExact (sym_get_const (ctx , right )));
228- PyObject * temp = _PyCompactLong_Add ((PyLongObject * )sym_get_const (ctx , left ),
229- (PyLongObject * )sym_get_const (ctx , right ));
230- if (temp == NULL ) {
231- goto error ;
232- }
233- res = sym_new_const (ctx , temp );
234- Py_DECREF (temp );
235- // TODO gh-115506:
236- // replace opcode with constant propagated one and add tests!
237- }
238- else {
239- res = sym_new_type (ctx , & PyLong_Type );
240- }
225+ res = sym_new_type (ctx , & PyLong_Type );
241226 }
242227
243228 op (_BINARY_OP_SUBTRACT_INT , (left , right -- res )) {
244- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
245- assert (PyLong_CheckExact (sym_get_const (ctx , left )));
246- assert (PyLong_CheckExact (sym_get_const (ctx , right )));
247- PyObject * temp = _PyCompactLong_Subtract ((PyLongObject * )sym_get_const (ctx , left ),
248- (PyLongObject * )sym_get_const (ctx , right ));
249- if (temp == NULL ) {
250- goto error ;
251- }
252- res = sym_new_const (ctx , temp );
253- Py_DECREF (temp );
254- // TODO gh-115506:
255- // replace opcode with constant propagated one and add tests!
256- }
257- else {
258- res = sym_new_type (ctx , & PyLong_Type );
259- }
229+ res = sym_new_type (ctx , & PyLong_Type );
260230 }
261231
262232 op (_BINARY_OP_MULTIPLY_INT , (left , right -- res )) {
263- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
264- assert (PyLong_CheckExact (sym_get_const (ctx , left )));
265- assert (PyLong_CheckExact (sym_get_const (ctx , right )));
266- PyObject * temp = _PyCompactLong_Multiply ((PyLongObject * )sym_get_const (ctx , left ),
267- (PyLongObject * )sym_get_const (ctx , right ));
268- if (temp == NULL ) {
269- goto error ;
270- }
271- res = sym_new_const (ctx , temp );
272- Py_DECREF (temp );
273- // TODO gh-115506:
274- // replace opcode with constant propagated one and add tests!
275- }
276- else {
277- res = sym_new_type (ctx , & PyLong_Type );
278- }
233+ res = sym_new_type (ctx , & PyLong_Type );
279234 }
280235
281236 op (_BINARY_OP_ADD_FLOAT , (left , right -- res )) {
0 commit comments