diff options
author | Andy Wingo <wingo@pobox.com> | 2013-07-19 16:19:34 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-07-21 17:12:21 +0200 |
commit | 081cf91029c7e7527e64fab5c9069262a345b10a (patch) | |
tree | bf9fb2177589bcb5326c5b8ebe2ef77cb8da2321 | |
parent | f82f62944a4e605d385f40b5a4a01e19677bc0b3 (diff) | |
download | guile-081cf91029c7e7527e64fab5c9069262a345b10a.tar.gz |
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!
-rw-r--r-- | libguile/programs.c | 2 | ||||
-rw-r--r-- | module/system/vm/debug.scm | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libguile/programs.c b/libguile/programs.c index d8dd3783b..8b346edd2 100644 --- a/libguile/programs.c +++ b/libguile/programs.c @@ -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); diff --git a/module/system/vm/debug.scm b/module/system/vm/debug.scm index c70f7c5b1..0e97df566 100644 --- a/module/system/vm/debug.scm +++ b/module/system/vm/debug.scm @@ -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)))))) |