Subject: Re: bug#36740: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant)

From: Noam Postavsky <[email-masked]>
Date: Thu, 01 Aug 2019 13:14:43 -0400

Pip Cet <[email-masked]> writes:

> Note that the test leaks entries in translation-hash-table-vector, but
> I think it's cleaner to start with a new symbol each time we run the
> test.

I don't really see the point in using a fresh symbol here; but if you do
insist on that, let-binding translation-hash-table-vector should stop
the leak, right?

> +(ert-deftest ccl-hash-table ()
> +  (let ((sym (gensym))
> +        (table (make-hash-table :test 'eq)))
> +    (puthash 16 17 table)
> +    (puthash 17 16 table)
> +    (define-translation-hash-table sym table)
> +    (let* ((prog `(2
> +                   ((loop
> +                     (lookup-integer ,sym r0 r1)))))
> +           (compiled (ccl-compile prog))
> +           (registers [17 0 0 0 0 0 0 0]))
> +      (ccl-execute compiled registers)
> +      (should (equal registers [2 16 0 0 0 0 0 1])))))