@@ -118,10 +118,11 @@ dummy_func(void) {
118
118
if (temp == NULL ) {
119
119
goto error ;
120
120
}
121
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
121
+ res = sym_new_const (ctx , temp );
122
+ Py_DECREF (temp );
123
+ OUT_OF_SPACE_IF_NULL (res );
122
124
// TODO gh-115506:
123
125
// replace opcode with constant propagated one and add tests!
124
- Py_DECREF (temp );
125
126
}
126
127
else {
127
128
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyLong_Type ));
@@ -139,10 +140,11 @@ dummy_func(void) {
139
140
if (temp == NULL ) {
140
141
goto error ;
141
142
}
142
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
143
+ res = sym_new_const (ctx , temp );
144
+ Py_DECREF (temp );
145
+ OUT_OF_SPACE_IF_NULL (res );
143
146
// TODO gh-115506:
144
147
// replace opcode with constant propagated one and add tests!
145
- Py_DECREF (temp );
146
148
}
147
149
else {
148
150
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyLong_Type ));
@@ -160,10 +162,11 @@ dummy_func(void) {
160
162
if (temp == NULL ) {
161
163
goto error ;
162
164
}
163
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
165
+ res = sym_new_const (ctx , temp );
166
+ Py_DECREF (temp );
167
+ OUT_OF_SPACE_IF_NULL (res );
164
168
// TODO gh-115506:
165
169
// replace opcode with constant propagated one and add tests!
166
- Py_DECREF (temp );
167
170
}
168
171
else {
169
172
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyLong_Type ));
@@ -182,10 +185,11 @@ dummy_func(void) {
182
185
if (temp == NULL ) {
183
186
goto error ;
184
187
}
185
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
188
+ res = sym_new_const (ctx , temp );
189
+ Py_DECREF (temp );
190
+ OUT_OF_SPACE_IF_NULL (res );
186
191
// TODO gh-115506:
187
192
// replace opcode with constant propagated one and update tests!
188
- Py_DECREF (temp );
189
193
}
190
194
else {
191
195
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyFloat_Type ));
@@ -204,10 +208,11 @@ dummy_func(void) {
204
208
if (temp == NULL ) {
205
209
goto error ;
206
210
}
207
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
211
+ res = sym_new_const (ctx , temp );
212
+ Py_DECREF (temp );
213
+ OUT_OF_SPACE_IF_NULL (res );
208
214
// TODO gh-115506:
209
215
// replace opcode with constant propagated one and update tests!
210
- Py_DECREF (temp );
211
216
}
212
217
else {
213
218
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyFloat_Type ));
@@ -226,10 +231,11 @@ dummy_func(void) {
226
231
if (temp == NULL ) {
227
232
goto error ;
228
233
}
229
- OUT_OF_SPACE_IF_NULL (res = sym_new_const (ctx , temp ));
234
+ res = sym_new_const (ctx , temp );
235
+ Py_DECREF (temp );
236
+ OUT_OF_SPACE_IF_NULL (res );
230
237
// TODO gh-115506:
231
238
// replace opcode with constant propagated one and update tests!
232
- Py_DECREF (temp );
233
239
}
234
240
else {
235
241
OUT_OF_SPACE_IF_NULL (res = sym_new_type (ctx , & PyFloat_Type ));
0 commit comments