Skip to content

Commit

Permalink
hotfix: workaround for unknown opcodes stopping decompilation
Browse files Browse the repository at this point in the history
this is far from the ideal solution, as the code comes incomplete, but is better than not decompiling the file at all

this workaround was proposed by https://github.com/zrax/pycdc/issues/307\#issuecomment-1382103504
  • Loading branch information
Luiz Eduardo Amorim Ramos Miranda committed Apr 27, 2023
1 parent c815673 commit b354442
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,10 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
stack.push(nullptr);
break;
default:
fprintf(stderr, "Unsupported opcode: %s\n", Pyc::OpcodeName(opcode & 0xFF));
cleanBuild = false;
return new ASTNodeList(defblock->nodes());
stack.pop();
// fprintf(stderr, "Unsupported opcode: %s\n", Pyc::OpcodeName(opcode & 0xFF));
// cleanBuild = false;
// return new ASTNodeList(defblock->nodes());
}

else_pop = ( (curblock->blktype() == ASTBlock::BLK_ELSE)
Expand Down

0 comments on commit b354442

Please sign in to comment.