Permalink
Browse files

Use tail call when loading required modules to avoid frame visible in…

… backtrace
  • Loading branch information...
1 parent eb6911b commit 7e3dc30687aff3e78285d4fb34fdfe8f2404cb54 @feeley feeley committed Feb 9, 2014
Showing with 11 additions and 6 deletions.
  1. +2 −2 include/stamp.h
  2. +9 −4 lib/_kernel.scm
View
@@ -2,5 +2,5 @@
* Time stamp of last source code repository commit.
*/
-#define ___STAMP_YMD 20140208
-#define ___STAMP_HMS 34641
+#define ___STAMP_YMD 20140209
+#define ___STAMP_HMS 180955
View
@@ -4545,12 +4545,17 @@ end-of-code
(if (##pair? modules)
(let* ((module (##car modules))
(module-descr (macro-module-descr module))
- (rest (##cdr modules)))
+ (rest (##cdr modules))
+ (last? (##not (##pair? rest))))
;; load module if the preload flag is set or we force the loading
(if (or (##fx= (##fxand 1 (##vector-ref module-descr 2)) 1)
- (and force-load-last? (##not (##pair? rest))))
- (proc module))
- (loop rest)))))
+ (and force-load-last? last?))
+ (if last?
+ (proc module)
+ (begin
+ (proc module)
+ (loop rest)))
+ (loop rest))))))
(for-each-module init)
(for-each-module run))

0 comments on commit 7e3dc30

Please sign in to comment.