mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Python: CG trace: Remove Python 3.8 only f"{var=}" usage
This commit is contained in:
@@ -155,7 +155,9 @@ def expr_that_added_elem_to_stack(
|
|||||||
immediately. (since correctly process the bytecode when faced with jumps is not as
|
immediately. (since correctly process the bytecode when faced with jumps is not as
|
||||||
straight forward).
|
straight forward).
|
||||||
"""
|
"""
|
||||||
LOGGER.debug(f"find_inst_that_added_elem_to_stack {start_index=} {stack_pos=}")
|
LOGGER.debug(
|
||||||
|
f"find_inst_that_added_elem_to_stack start_index={start_index} stack_pos={stack_pos}"
|
||||||
|
)
|
||||||
assert stack_pos >= 0
|
assert stack_pos >= 0
|
||||||
for inst in reversed(instructions[: start_index + 1]):
|
for inst in reversed(instructions[: start_index + 1]):
|
||||||
# Return immediately if faced with a jump
|
# Return immediately if faced with a jump
|
||||||
@@ -179,7 +181,7 @@ def expr_that_added_elem_to_stack(
|
|||||||
def expr_from_instruction(instructions: List[Instruction], index: int) -> BytecodeExpr:
|
def expr_from_instruction(instructions: List[Instruction], index: int) -> BytecodeExpr:
|
||||||
inst = instructions[index]
|
inst = instructions[index]
|
||||||
|
|
||||||
LOGGER.debug(f"expr_from_instruction: {inst} {index=}")
|
LOGGER.debug(f"expr_from_instruction: {inst} index={index}")
|
||||||
|
|
||||||
if inst.opname in ["LOAD_GLOBAL", "LOAD_FAST", "LOAD_NAME", "LOAD_DEREF"]:
|
if inst.opname in ["LOAD_GLOBAL", "LOAD_FAST", "LOAD_NAME", "LOAD_DEREF"]:
|
||||||
return BytecodeVariableName(inst.argval)
|
return BytecodeVariableName(inst.argval)
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ class CallGraphTracer:
|
|||||||
if event not in ["call", "c_call"]:
|
if event not in ["call", "c_call"]:
|
||||||
return
|
return
|
||||||
|
|
||||||
LOGGER.debug(f"profilefunc {event=}")
|
LOGGER.debug(f"profilefunc event={event}")
|
||||||
if event == "call":
|
if event == "call":
|
||||||
# in call, the `frame` argument is new the frame for entering the callee
|
# in call, the `frame` argument is new the frame for entering the callee
|
||||||
assert frame.f_back is not None
|
assert frame.f_back is not None
|
||||||
|
|||||||
Reference in New Issue
Block a user