diff options
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 2ccfd0a..8d9e94a 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -414,10 +414,16 @@ dummy_func(void) { } } + op(_GUARD_TOS_UNICODE, (value -- value)) { + if (sym_matches_type(value, &PyUnicode_Type)) { + REPLACE_OP(this_instr, _NOP, 0, 0); + } + sym_set_type(value, &PyUnicode_Type); + } + op(_TO_BOOL_STR, (value -- res)) { if (!optimize_to_bool(this_instr, ctx, value, &res)) { res = sym_new_truthiness(ctx, value, true); - sym_set_type(value, &PyUnicode_Type); } } |