lpython
lpython copied to clipboard
Introducing basic_free_stack_if_not_null
Addressing https://github.com/lcompilers/lpython/issues/2614#issuecomment-2035025925
We have been using the basic_free_stack
out of symengine's C wrapper untill now. But before freeing out variables we need to check if they have been stack allocated previously. Hence this PR aims to replace every basic_free_stack
call with
if (var != NULL) {
basic_free_stack(var);
}
I tried approach 1 & 2 as mentioned here (https://github.com/lcompilers/lpython/issues/2614#issuecomment-2009981787) but haven't been able to address the example in consideration fully. cc @Thirumalai-Shaktivel could you try helping me out here ?
@anutosh491 what is the status here --- can you describe what the problem is?
Are you trying to address this comment: https://github.com/lcompilers/lpython/issues/2614#issuecomment-2035025925 ?