summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2022-02-01 12:16:12 +0100
committerAndy Wingo <wingo@pobox.com>2022-02-01 14:50:44 +0100
commit9654ab1f210720b55a2511a425f93abb48375bf4 (patch)
tree4c3630dc5f6b7224e3262509775fd017144fba8d /module
parent9b9149a5bf6206c9f01bcc59c9d297364a6c1ccf (diff)
downloadguile-9654ab1f210720b55a2511a425f93abb48375bf4.tar.gz
Fix reproducibility for inlinable-exports
* module/language/tree-il/inlinable-exports.scm (compute-decoder): Map items in order of their code.
Diffstat (limited to 'module')
-rw-r--r--module/language/tree-il/inlinable-exports.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/language/tree-il/inlinable-exports.scm b/module/language/tree-il/inlinable-exports.scm
index 0873fb078..76bb7da9f 100644
--- a/module/language/tree-il/inlinable-exports.scm
+++ b/module/language/tree-il/inlinable-exports.scm
@@ -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)