summaryrefslogtreecommitdiff
path: root/module/language/tree-il
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-06-07 00:53:31 +0200
committerAndy Wingo <wingo@pobox.com>2009-06-07 00:53:48 +0200
commitc0ee32452f4babfc99526ed35d1f80d128d8658b (patch)
tree90a02f33aa08527277dd0fa52099206c26c76761 /module/language/tree-il
parent586cfdecfa4021e725287a02b57624418e597354 (diff)
downloadguile-c0ee32452f4babfc99526ed35d1f80d128d8658b.tar.gz
fix incorrect inlining of + when + is locally redefined
* libguile/vm-i-scheme.c (FUNC2): Use a signed value for the intermediate result here. Not sure what the effect is, though. * module/ice-9/psyntax.scm (chi-top): Toplevel definitions ensure that variables are defined in the current module. Fixes the specific case of guile-lib's md5.scm, which redefines + -- this code is needed so that we don't incorrectly open-code +. * module/language/tree-il/primitives.scm (resolve-primitives!): I think there were some cases in which vars and names would not resolve properly here. Fix those.
Diffstat (limited to 'module/language/tree-il')
-rw-r--r--module/language/tree-il/primitives.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/language/tree-il/primitives.scm b/module/language/tree-il/primitives.scm
index 51bbfeae9..6ce538490 100644
--- a/module/language/tree-il/primitives.scm
+++ b/module/language/tree-il/primitives.scm
@@ -63,16 +63,17 @@
(lambda (x)
(record-case x
((<toplevel-ref> src name)
- (and (hashq-ref *interesting-primitive-vars*
- (module-variable mod name))
- (make-primitive-ref src name)))
+ (and=> (hashq-ref *interesting-primitive-vars*
+ (module-variable mod name))
+ (lambda (name) (make-primitive-ref src name))))
((<module-ref> src mod name public?)
;; for the moment, we're disabling primitive resolution for
;; public refs because resolve-interface can raise errors.
(let ((m (and (not public?) (resolve-module mod))))
- (and m (hashq-ref *interesting-primitive-vars*
- (module-variable m name))
- (make-primitive-ref src name))))
+ (and m
+ (and=> (hashq-ref *interesting-primitive-vars*
+ (module-variable m name))
+ (lambda (name) (make-primitive-ref src name))))))
(else #f)))
x))