Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to decompile opcode PUSH_EXC_INFO failed #519

Open
1wxyz opened this issue Sep 13, 2024 · 0 comments
Open

Trying to decompile opcode PUSH_EXC_INFO failed #519

1wxyz opened this issue Sep 13, 2024 · 0 comments

Comments

@1wxyz
Copy link

1wxyz commented Sep 13, 2024

Trying to implement opcode PUSH_EXC_INFO with the notes from https://docs.python.org/3/library/dis.html#opcode-PUSH_EXC_INFO

case Pyc::PUSH_EXC_INFO:
            {
                PycRef<ASTNode> popped = stack.top();
                stack.pop();

                PycRef<ASTBlock> except = new ASTCondBlock(ASTBlock::BLK_EXCEPT, 0, NULL, false);
                except->init();
                stack.push(except.cast<ASTNode>());
                stack.push(popped);
            }
            break;

Based on the code above, I was trying to implement: 'Pushes the current exception to the top of the stack. ', which ended up with Segmentation fault (core dumped).

When I change stack.push(except.cast<ASTNode>()); to blocks.push(except); , it gives this error:
Error decompyling file.pyc: vector::_M_range_check: __n (which is 3) >= this->size() (which is 2)

Not sure what is the correct way to write in pycdc. Thanks for any advise given in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant