Mining gold doesnt mean that they will sell it straight away.
For all you know, they could be mining it (incurring expenses) and instead of selling it straight, they stock it up and wait for the right moment to dispose it off.
And if they are running out of cashflow, they still have undrawned bank facilities or they could issue more corporate bonds or worst comes to worst capital raising.