This commit is contained in:
blueloveTH 2025-06-05 20:05:43 +08:00
parent a21765a9ca
commit 6b592b11df
2 changed files with 4 additions and 3 deletions

View File

@ -84,7 +84,8 @@ static bool disassemble(CodeObject* co) {
case OP_BEGIN_CLASS:
case OP_DELETE_GLOBAL:
case OP_STORE_CLASS_ATTR: {
pk_sprintf(&ss, " (%n)", byte.arg);
py_Name name = c11__getitem(py_Name, &co->names, byte.arg);
pk_sprintf(&ss, " (%n)", name);
break;
}
case OP_LOAD_FAST:

View File

@ -53,10 +53,10 @@ static bool namedict_items(int argc, py_Ref argv) {
NameDict* dict = PyObject__dict(object->_obj);
py_newlist(py_retval());
for(int i = 0; i < dict->capacity; i++) {
py_Ref slot = py_list_emplace(py_retval());
py_Ref p = py_newtuple(slot, 2);
NameDict_KV* kv = &dict->items[i];
if(kv->key == NULL) continue;
py_Ref slot = py_list_emplace(py_retval());
py_Ref p = py_newtuple(slot, 2);
p[0] = *py_name2ref(kv->key);
p[1] = kv->value;
}