mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-106267: Add type cast to generated code (#106289)
This commit is contained in:
parent
02ce3d56e6
commit
2062e11501
2 changed files with 2 additions and 2 deletions
2
Python/executor_cases.c.h
generated
2
Python/executor_cases.c.h
generated
|
@ -187,7 +187,7 @@
|
||||||
case TO_BOOL_ALWAYS_TRUE: {
|
case TO_BOOL_ALWAYS_TRUE: {
|
||||||
PyObject *value = stack_pointer[-1];
|
PyObject *value = stack_pointer[-1];
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
uint32_t version = operand;
|
uint32_t version = (uint32_t)operand;
|
||||||
#line 359 "Python/bytecodes.c"
|
#line 359 "Python/bytecodes.c"
|
||||||
// This one is a bit weird, because we expect *some* failures:
|
// This one is a bit weird, because we expect *some* failures:
|
||||||
assert(version);
|
assert(version);
|
||||||
|
|
|
@ -520,7 +520,7 @@ class Instruction:
|
||||||
f"{typ}{ceffect.name} = {func}(&next_instr[{active.offset}].cache);"
|
f"{typ}{ceffect.name} = {func}(&next_instr[{active.offset}].cache);"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
out.emit(f"{typ}{ceffect.name} = operand;")
|
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})operand;")
|
||||||
|
|
||||||
# Write the body, substituting a goto for ERROR_IF() and other stuff
|
# Write the body, substituting a goto for ERROR_IF() and other stuff
|
||||||
assert dedent <= 0
|
assert dedent <= 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue