gh-134584: Eliminate redundant refcounting from _CALL_STR_1 (GH-136070)

Signed-off-by: Manjusaka <me@manjusaka.me>
This commit is contained in:
Nadeshiko Manju 2025-12-14 17:33:05 +08:00 committed by GitHub
parent d3ef5ba34d
commit a154c9ed4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 58 additions and 43 deletions

View file

@ -951,7 +951,7 @@ dummy_func(void) {
}
}
op(_CALL_STR_1, (unused, unused, arg -- res)) {
op(_CALL_STR_1, (unused, unused, arg -- res, a)) {
if (sym_matches_type(arg, &PyUnicode_Type)) {
// e.g. str('foo') or str(foo) where foo is known to be a string
// Note: we must strip the reference information because it goes
@ -961,6 +961,7 @@ dummy_func(void) {
else {
res = sym_new_type(ctx, &PyUnicode_Type);
}
a = arg;
}
op(_CALL_ISINSTANCE, (unused, unused, instance, cls -- res)) {