Skip to content

Commit

Permalink
Print out frozenset in disasm too
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace314159 committed Feb 14, 2023
1 parent 80e835e commit ca73f05
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bytecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,21 @@ void print_const(PycRef<PycObject> obj, PycModule* mod, const char* parent_f_str
fputs("}", pyc_output);
}
break;
case PycObject::TYPE_FROZENSET:
{
fputs("frozenset({", pyc_output);
PycSet::value_t values = obj.cast<PycSet>()->values();
auto it = values.cbegin();
if (it != values.cend()) {
print_const(*it, mod);
while (++it != values.cend()) {
fputs(", ", pyc_output);
print_const(*it, mod);
}
}
fputs("})", pyc_output);
}
break;
case PycObject::TYPE_NONE:
fputs("None", pyc_output);
break;
Expand Down Expand Up @@ -312,6 +327,8 @@ void print_const(PycRef<PycObject> obj, PycModule* mod, const char* parent_f_str
case PycObject::TYPE_CODE2:
fprintf(pyc_output, "<CODE> %s", obj.cast<PycCode>()->name()->value());
break;
default:
fprintf(pyc_output, "<TYPE: %d>\n", obj->type());
}
}

Expand Down

0 comments on commit ca73f05

Please sign in to comment.