Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Jan 13, 2025
1 parent c1a6652 commit e198894
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def test_error_if_plain(self):
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP);
if (cond) CEVAL_GOTO(label);
if (cond) goto label;
DISPATCH();
}
"""
Expand All @@ -557,7 +557,7 @@ def test_error_if_plain_with_comment(self):
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP);
if (cond) CEVAL_GOTO(label);
if (cond) goto label;
// Comment is ok
DISPATCH();
}
Expand All @@ -584,7 +584,7 @@ def test_error_if_pop(self):
right = stack_pointer[-1];
left = stack_pointer[-2];
SPAM(left, right);
if (cond) CEVAL_GOTO(pop_2_label);
if (cond) goto pop_2_label;
res = 0;
stack_pointer[-2] = res;
stack_pointer += -1;
Expand Down Expand Up @@ -613,7 +613,7 @@ def test_error_if_pop_with_result(self):
right = stack_pointer[-1];
left = stack_pointer[-2];
res = SPAM(left, right);
if (cond) CEVAL_GOTO(pop_2_label);
if (cond) goto pop_2_label;
stack_pointer[-2] = res;
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
Expand Down Expand Up @@ -931,7 +931,7 @@ def test_array_error_if(self):
if (oparg == 0) {
stack_pointer += -1 - oparg;
assert(WITHIN_STACK_BOUNDS());
CEVAL_GOTO(somewhere);
goto somewhere;
}
stack_pointer += -1 - oparg;
assert(WITHIN_STACK_BOUNDS());
Expand Down Expand Up @@ -1394,7 +1394,7 @@ def test_pop_on_error_peeks(self):
// THIRD
{
// Mark j and k as used
if (cond) CEVAL_GOTO(pop_2_error);
if (cond) goto pop_2_error;
}
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
Expand Down Expand Up @@ -1437,7 +1437,7 @@ def test_push_then_error(self):
stack_pointer[1] = b;
stack_pointer += 2;
assert(WITHIN_STACK_BOUNDS());
CEVAL_GOTO(error);
goto error;
}
}
stack_pointer[0] = a;
Expand All @@ -1464,14 +1464,14 @@ def test_error_if_true(self):
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP1);
CEVAL_GOTO(here);
goto here;
}
TARGET(OP2) {
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP2);
CEVAL_GOTO(there);
goto there;
}
"""
self.run_cases_test(input, output)
Expand Down Expand Up @@ -1854,7 +1854,7 @@ def test_fallthrough_label(self):
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_error(TAIL_CALL_PARAMS)
{
DO_THING();
CEVAL_GOTO(fallthrough);
TAIL_CALL(fallthrough);
}
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_fallthrough(TAIL_CALL_PARAMS)
Expand Down Expand Up @@ -1888,10 +1888,10 @@ def test_transform_gotos(self):
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_error(TAIL_CALL_PARAMS)
{
if (thing) {
CEVAL_GOTO(fallthrough);
TAIL_CALL(fallthrough);
}
DO_THING();
CEVAL_GOTO(fallthrough);
TAIL_CALL(fallthrough);
}
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_fallthrough(TAIL_CALL_PARAMS)
Expand Down
3 changes: 2 additions & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,8 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)

#ifdef Py_TAIL_CALL_INTERP
#include "generated_tail_call_handlers.c.h"
static inline PyObject *_TAIL_CALL_shim(TAIL_CALL_PARAMS)
static inline PyObject *
_TAIL_CALL_shim(TAIL_CALL_PARAMS)
{
opcode = next_instr->op.code;
oparg = next_instr->op.arg;
Expand Down

0 comments on commit e198894

Please sign in to comment.