1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

fix rtl program arity functions

* libguile/programs.c (parse_arity): Lookup rtl-program-minimum-arity
  from (system vm debug).

* module/system/vm/debug.scm (find-first-arity): Fix the linear search.
  Whoops!
This commit is contained in:
Andy Wingo 2013-07-19 16:19:34 +02:00
parent f82f62944a
commit 081cf91029
2 changed files with 4 additions and 4 deletions

View file

@ -482,7 +482,7 @@ scm_i_rtl_program_minimum_arity (SCM program, int *req, int *opt, int *rest)
if (scm_is_false (rtl_program_minimum_arity) && scm_module_system_booted_p)
rtl_program_minimum_arity =
scm_c_private_variable ("system vm debug",
scm_c_private_variable ("system vm program",
"rtl-program-minimum-arity");
l = scm_call_1 (scm_variable_ref (rtl_program_minimum_arity), program);

View file

@ -292,10 +292,10 @@ section of the ELF image. Returns an ELF symbol, or @code{#f}."
(let lp ((pos headers-start))
(cond
((>= pos headers-end) #f)
((< text-offset (arity-low-pc* bv pos))
(lp (+ pos arity-header-len)))
((< (arity-high-pc* bv pos) text-offset)
((< text-offset (* (arity-low-pc* bv pos) 4))
#f)
((<= (* (arity-high-pc* bv pos) 4) text-offset)
(lp (+ pos arity-header-len)))
(else
(make-arity context base pos))))))