1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Fix reproducibility for inlinable-exports

* module/language/tree-il/inlinable-exports.scm (compute-decoder): Map
items in order of their code.
This commit is contained in:
Andy Wingo 2022-02-01 12:16:12 +01:00
parent 9b9149a5bf
commit 9654ab1f21

View file

@ -753,6 +753,12 @@
(make-struct/simple (@ ,mod ,name) ,@fields)))))))
(define (constant-clause constant code)
`((eq? code ,code) ',constant))
(define (map-encodings f table)
(map (match-lambda
((value . code) (f value code)))
(sort (hash-map->list cons table)
(match-lambda*
(((_ . code1) (_ . code2)) (< code1 code2))))))
`(lambda (bv)
(define pos 0)
@ -785,8 +791,8 @@
,@(if (symbol-code encoding)
(list (symbol-clause (symbol-code encoding)))
'())
,@(hash-map->list vtable-clause (vtables encoding))
,@(hash-map->list constant-clause (constants encoding))
,@(map-encodings vtable-clause (vtables encoding))
,@(map-encodings constant-clause (constants encoding))
(else (error "bad code" code)))))))
(define (encode term encoding)