Skip to content

Fix: WhileStmt body pop crashes on empty result stack #241

@yuvimittal

Description

@yuvimittal

Summary

After visiting the loop body, the code unconditionally calls self.result_stack.pop() and then checks if not body_val. If the body visits a void-returning statement (e.g. a bare assignment or a print), nothing is pushed and the pop raises IndexError.

OS / Environment

-

Steps to Reproduce

File Upload (optional)

No response

Expected Results

Actual Results

-

IRx version

-

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions