Skip to content

Trying to decompile opcode PUSH_EXC_INFO failed #519

Open
@1wxyz

Description

@1wxyz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions