Skip to content

Enhance error diagnostics in safe_pop() to provide context about failed pops #145

@iihimanshuu

Description

@iihimanshuu

Issue Description:

The safe_pop() utility function line 64 in llvmliteir.py silently returns None when the stack is empty, making debugging difficult when code paths don't push values correctly. Currently, this can hide bugs in visitor dispatch. Improvements:

  • Add optional logging/warnings when pop fails
  • Provide context about which operation failed
  • Helps catch visitor implementation bugs early

Change needed:

Enhance the safe_pop() function to optionally log or raise an exception with context when popping from an empty stack, particularly useful during development and debugging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions