Can't add liquidity on PancakeSwap with burnable ERC20 token

Actually when I try to add liquidity on testnet using pancakeswap’s own router and factory address I am successful and get LP tokens in return. But if I try to do the same with the router and factory address generated by my code I always get hijacked stack error. This is the link to my question Unable to add liquidity to pancakeswap can you have a look please?