Subject: bug#35770: [PATCH] Broken duplicate case elimination in switch byte-compilation

From: Mattias Engdegård <[email-masked]>
Date: Fri, 17 May 2019 11:33:41 +0200

The byte-code compiler attempts to eliminate duplicated cases when turning a `cond' into a switch table, as in

  (cond ((eq x 'a) 1)
         (eq x 'b) 2)
         (eq x 'a) 3)) ; remove

but it doesn't work properly, because of a confusion between expressions and their values, and a logic error that would have discarded the entire table instead of just skipped the duplicate.

This patch attempts to rectify that. I also removed a seemingly redundant condition, the (consp condition), which should always be true at that point.