OSSFuzz found the following counter-example to the fix described above:

<blockquote><verbatim>
SELECT(WITH c AS(VALUES(1))SELECT '' FROM c,c) x WHERE x+x;


The query above fails with check-in [4678cb1044f0b4dc8] but works before then.