mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +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:
parent
586cfdecfa
commit
c0ee32452f
4 changed files with 12 additions and 8 deletions
|
@ -197,7 +197,7 @@ VM_DEFINE_FUNCTION (99, ge, "ge?", 2)
|
|||
ARGS2 (x, y); \
|
||||
if (SCM_I_INUMP (x) && SCM_I_INUMP (y)) \
|
||||
{ \
|
||||
scm_t_bits n = SCM_I_INUM (x) CFUNC SCM_I_INUM (y);\
|
||||
scm_t_int64 n = SCM_I_INUM (x) CFUNC SCM_I_INUM (y);\
|
||||
if (SCM_FIXABLE (n)) \
|
||||
RETURN (SCM_I_MAKINUM (n)); \
|
||||
} \
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1178,6 +1178,9 @@
|
|||
(type (binding-type (lookup n r mod))))
|
||||
(case type
|
||||
((global core macro module-ref)
|
||||
;; affect compile-time environment
|
||||
(if (not (module-local-variable (current-module) n))
|
||||
(module-define! (current-module) n #f))
|
||||
(eval-if-c&e m
|
||||
(build-global-definition s n (chi e r w mod))
|
||||
mod))
|
||||
|
|
|
@ -63,16 +63,17 @@
|
|||
(lambda (x)
|
||||
(record-case x
|
||||
((<toplevel-ref> src name)
|
||||
(and (hashq-ref *interesting-primitive-vars*
|
||||
(and=> (hashq-ref *interesting-primitive-vars*
|
||||
(module-variable mod name))
|
||||
(make-primitive-ref src 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*
|
||||
(and m
|
||||
(and=> (hashq-ref *interesting-primitive-vars*
|
||||
(module-variable m name))
|
||||
(make-primitive-ref src name))))
|
||||
(lambda (name) (make-primitive-ref src name))))))
|
||||
(else #f)))
|
||||
x))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue