The Anglo trial has heard former Chief Executive David Drumm raised the possibility of legal issues over the bank lending money to buy its own shares four months before the loans were issued.

The loans are now the subject of criminal charges. 

The former chief financial officer of Anglo Irish Bank, Matt Moran, is being cross-examined by defence lawyers in the Dublin Circuit Criminal Court.

The former chairman of the bank, Seán FitzPatrick, and two former directors of the bank, Patrick Whelan and William McAteer, are on trial charged with giving unlawful loans to 16 people to buy shares in the bank.

All three men deny the charges.

Mr Whelan denies a further seven charges of being involved in the fraudulent alteration of a document.

Former chief financial officer Matt Moran, who has immunity from prosecution, was in the witness box for a third day today. 

Mr Moran confirmed to lawyers for Mr Whelan that he has immunity from prosecution on a "whole range of matters".

He agreed it was possible that there were matters in the pipeline that he would be expected to give evidence on other than the matters in this trial.

He was asked about a series of emails in March 2008, around the time the bank was first trying to finalise an agreement to unwind Seán Quinn's interest in the bank's shares through Contracts for Difference.

The court heard the bank's former chief executive David Drumm raised the possibility of a legal issue arising under company law relating to the bank lending against its own shares.

Mr Drumm asked Mr Moran if there would be such a legal issue if the bank had the approval of the regulator.

And Mr Drumm also said as he understood it the bank had an "out" under a section of the companies act, if the lending was in the ordinary course of business, which he said in the bank's case was lending.

Mr Moran also told the court the Financial Regulator wanted references to the regulator to be removed from an agreement prepared by the bank's solicitor in March to allow the unwind of the CFD position to proceed.

Mr Moran said it was not his experience that the regulator would reply in writing to emails from people in the bank.

He said the regulator would raise certain issues in phone conversations and the bank would try and address these issues.

He said he would expect that if there was a problem a red flag would be raised by the regulator in the ongoing dialogue and correspondence.

Mr Moran said during discussions with the bank's solicitor, Robert Herron, in March 2008, Mr Herron said the regulator would raise no objection to the deal - he said this was a form of approval without actually saying they approved.

The March agreement did not go ahead because the bank could not find investors willing to buy a portion of the shares in which Seán Quinn had an interest.