Skip to content

Commit d7a99c1

Browse files
pablogsalFidget-Spinnersweeneyde
authored
Apply suggestions from code review
Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Dennis Sweeney <[email protected]>
1 parent e1091e0 commit d7a99c1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,10 +4636,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
46364636
PyObject *res;
46374637

46384638
// Check if the call can be inlined or not
4639-
PyObject *function = *(stack_pointer - oparg - 1);
4639+
PyObject *function = PEEK(oparg + 1);
46404640
int inline_call = 0;
46414641
if (Py_TYPE(function) == &PyFunction_Type) {
4642-
PyCodeObject *code = (PyCodeObject*)((PyFunctionObject*)(function))->func_code;
4642+
PyCodeObject *code = (PyCodeObject*)PyFunction_GET_CODE(function);
46434643
int is_coro = code->co_flags & (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR);
46444644
inline_call = (is_coro || cframe.use_tracing) ? 0 : 1;
46454645
}

Tools/gdb/libpython.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,15 +1926,14 @@ def invoke(self, args, from_tty):
19261926
def move_in_stack(move_up):
19271927
'''Move up or down the stack (for the py-up/py-down command)'''
19281928
# Important:
1929-
# The ammount of frames that are printed out depends on how many frames are inlined
1929+
# The amount of frames that are printed out depends on how many frames are inlined
19301930
# in the same evaluation loop. As this command links directly the C stack with the
19311931
# Python stack, the results are sensitive to the number of inlined frames and this
19321932
# is likely to change between versions and optimizations.
19331933
frame = Frame.get_selected_python_frame()
19341934
if not frame:
19351935
print('Unable to locate python frame')
19361936
return
1937-
19381937
while frame:
19391938
if move_up:
19401939
iter_frame = frame.older()

0 commit comments

Comments
 (0)