I found what I was looking for, in connection with pornography, cannabis, and so on:
"Yes, indeed, lord. I understand the Dhamma taught by the Blessed One, and those acts the Blessed One says are obstructive, when indulged in are not genuine obstructions."
"Worthless man, from whom have you understood that Dhamma taught by me in such a way? Worthless man, haven't I in many ways described obstructive acts? And when indulged in they are genuine obstructions. I have said that sensual pleasures are of little satisfaction, much stress, much despair, & greater drawbacks. I have compared sensual pleasures to a chain of bones: of much stress, much despair, & greater drawbacks. I have compared sensual pleasures to a lump of flesh... a grass torch... a pit of glowing embers... a dream... borrowed goods... the fruits of a tree... a butcher's ax and chopping block... swords and spears... a snake's head: of much stress, much despair, & greater drawbacks. But you, worthless man, through your own wrong grasp [of the Dhamma], have both misrepresented us as well as injuring yourself and accumulating much demerit for yourself, for that will lead to your long-term harm & suffering."