Skip to content

Call basic_free_stack before return statement #2411

Closed
@Thirumalai-Shaktivel

Description

@Thirumalai-Shaktivel
from lpython import S
from sympy import pi

def func() -> S:
    print(pi)
    return pi

def test_func():
    print(func())

test_func()
(SubroutineCall
    2 basic_const_pi
    2 basic_const_pi
    [((Var 3 _lpython_return_variable))]
    ()
)
(Return)
(SubroutineCall                    ;; <== Here
    2 basic_free_stack
    2 basic_free_stack
    [((Var 3 _lpython_return_variable))]
    ()
)
(SubroutineCall
    2 basic_free_stack
    2 basic_free_stack
    [((Var 3 stack0))]
    ()
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions