When a witness is cross-examined, he may, in addition to the questions hereinbefore referred to, be asked any questions which tend–
(1) to test his veracity,
(2) to discover who he is and what is his position in life, or
(3) to shake his credit, by injuring his character, although the answer to such questions might tend directly or indirectly to criminate him or might expose or tend directly or indirectly to expose him to a penalty or forfeiture:
Provided that in a prosecution for an offence under section 376, section 376A, section 376B, section 376C, section 376D or section 376E of the Indian Penal Code (45 of 1860) or for attempt to commit any such offence, where the question of consent is an issue, it shall not be permissible to adduce evidence or to put questions in the cross-examination of the victim as to the general immoral character, or previous sexual experience, of such victim with any person for proving such consent or the quality of consent.