Skip to content

Commit f5d7107

Browse files
authored
Fix some incorrect indentation around the main switch (#98177)
The `}` marked with `/* End instructions */` is the end of the switch. There is another pair of `{}` around the switch, which is vestigial from ancient times when it was `for (;;) { switch (opcode) { ... } }`. All `DISPATCH` macro calls should be inside that pair.
1 parent 5ecf961 commit f5d7107

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

Python/ceval.c

+20-21
Original file line numberDiff line numberDiff line change
@@ -1152,12 +1152,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
11521152

11531153
{
11541154
/* Start instructions */
1155-
#if USE_COMPUTED_GOTOS
1156-
{
1157-
#else
1155+
#if !USE_COMPUTED_GOTOS
11581156
dispatch_opcode:
1159-
switch (opcode) {
1157+
switch (opcode)
11601158
#endif
1159+
{
11611160

11621161
/* BEWARE!
11631162
It is essential that any operation that fails must goto error
@@ -5102,23 +5101,23 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
51025101
/* Specialization misses */
51035102

51045103
miss:
5105-
{
5106-
STAT_INC(opcode, miss);
5107-
opcode = _PyOpcode_Deopt[opcode];
5108-
STAT_INC(opcode, miss);
5109-
/* The counter is always the first cache entry: */
5110-
_Py_CODEUNIT *counter = (_Py_CODEUNIT *)next_instr;
5111-
*counter -= 1;
5112-
if (*counter == 0) {
5113-
int adaptive_opcode = _PyOpcode_Adaptive[opcode];
5114-
assert(adaptive_opcode);
5115-
_Py_SET_OPCODE(next_instr[-1], adaptive_opcode);
5116-
STAT_INC(opcode, deopt);
5117-
*counter = adaptive_counter_start();
5118-
}
5119-
next_instr--;
5120-
DISPATCH_GOTO();
5121-
}
5104+
{
5105+
STAT_INC(opcode, miss);
5106+
opcode = _PyOpcode_Deopt[opcode];
5107+
STAT_INC(opcode, miss);
5108+
/* The counter is always the first cache entry: */
5109+
_Py_CODEUNIT *counter = (_Py_CODEUNIT *)next_instr;
5110+
*counter -= 1;
5111+
if (*counter == 0) {
5112+
int adaptive_opcode = _PyOpcode_Adaptive[opcode];
5113+
assert(adaptive_opcode);
5114+
_Py_SET_OPCODE(next_instr[-1], adaptive_opcode);
5115+
STAT_INC(opcode, deopt);
5116+
*counter = adaptive_counter_start();
5117+
}
5118+
next_instr--;
5119+
DISPATCH_GOTO();
5120+
}
51225121

51235122
unbound_local_error:
51245123
{

0 commit comments

Comments
 (0)