1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 17:50:29 +02:00

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.
This commit is contained in:
Andy Wingo 2009-06-07 00:53:31 +02:00
parent 586cfdecfa
commit c0ee32452f
4 changed files with 12 additions and 8 deletions

View file

@ -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))