From: Taylor R Campbell Date: Thu, 7 Oct 2010 02:33:06 +0000 (+0000) Subject: Fix PC-in-builtin detection. X-Git-Tag: 20101212-Gtk~51 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6aad350baa0fb00fd13e085e035ac512fd03acc8;p=mit-scheme.git Fix PC-in-builtin detection. n_builtins must be incremented if it is ever to exceed 0... --- diff --git a/src/microcode/cmpint.c b/src/microcode/cmpint.c index 4c5ee4c92..24b28ebe2 100644 --- a/src/microcode/cmpint.c +++ b/src/microcode/cmpint.c @@ -2812,7 +2812,7 @@ declare_builtin (unsigned long builtin, const char * name) } else { - unsigned int scan = n_builtins; + unsigned int scan = (n_builtins++); while (low < scan) { (builtins [scan]) = (builtins [scan - 1]); @@ -2837,6 +2837,7 @@ int pc_to_builtin_index (unsigned long pc) { if (! ((builtins != 0) + && (n_builtins > 0) && (pc >= (builtins[0])) && (pc < (builtins [(n_builtins - 1)])))) return (-1);