diff options
author | Andy Wingo <wingo@pobox.com> | 2014-07-21 12:19:33 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-07-21 21:38:17 +0200 |
commit | cf7a884f125de0a44ddccbc985a96e3a6eb62b8b (patch) | |
tree | 44959c7bb90e7042f924828e791335e482f87c79 | |
parent | 3ddd438179d98b0370592ea82b748de25d76c4d7 (diff) | |
download | guile-cf7a884f125de0a44ddccbc985a96e3a6eb62b8b.tar.gz |
Stabilize renumber.scm:sort-conts.
* module/language/cps/renumber.scm (sort-conts): Prevent spurious
continuation reordering.
-rw-r--r-- | module/language/cps/renumber.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/module/language/cps/renumber.scm b/module/language/cps/renumber.scm index 78425ab3c..4f51b7081 100644 --- a/module/language/cps/renumber.scm +++ b/module/language/cps/renumber.scm @@ -66,7 +66,14 @@ (let ((k-len (vector-ref path-lengths k)) (kt-len (vector-ref path-lengths kt))) (cond - ((and k-len kt-len (< k-len kt-len)) + ((if kt-len + (or (not k-len) + (< k-len kt-len) + ;; If the path lengths are the + ;; same, preserve original order + ;; to avoid squirreliness. + (and (= k-len kt-len) (< kt k))) + (if k-len #f (< kt k))) (maybe-visit k) (maybe-visit kt)) (else |