fix raise-syntax-error

svn: r13596
This commit is contained in:
Matthew Flatt 2009-02-15 03:05:02 +00:00
parent eed5f52878
commit 154cb8d1fd
3 changed files with 19 additions and 4 deletions

View File

@ -52,6 +52,12 @@
#define PAGEMAP32_BITS(x) (NUM(x) >> LOG_APAGE_SIZE)
#endif
#if 0
# define GC_ASSERT(x) assert(x)
#else
# define GC_ASSERT(x) /* empty */
#endif
/* the page type constants */
enum {
PAGE_TAGGED = 0,
@ -1827,7 +1833,7 @@ static void propagate_marks(NewGC *gc)
if((unsigned long)mark_table[tag] < PAGE_TYPES) {
/* atomic */
} else {
assert(mark_table[tag]);
GC_ASSERT(mark_table[tag]);
mark_table[tag](start); break;
}
}
@ -1838,7 +1844,7 @@ static void propagate_marks(NewGC *gc)
unsigned short tag = *(unsigned short *)start;
end -= INSET_WORDS;
while(start < end) {
assert(mark_table[tag]);
GC_ASSERT(mark_table[tag]);
start += mark_table[tag](start);
}
break;
@ -1853,7 +1859,7 @@ static void propagate_marks(NewGC *gc)
case PAGE_TAGGED:
{
unsigned short tag = *(unsigned short*)p;
assert(mark_table[tag]);
GC_ASSERT(mark_table[tag]);
mark_table[tag](p);
break;
}
@ -1869,7 +1875,7 @@ static void propagate_marks(NewGC *gc)
void **end = PPTR(info) + (info->size - INSET_WORDS);
unsigned short tag = *(unsigned short *)start;
while(start < end) {
assert(mark_table[tag]);
GC_ASSERT(mark_table[tag]);
start += mark_table[tag](start);
}
break;

View File

@ -18,6 +18,11 @@
#include <sys/types.h>
#include <unistd.h>
#ifndef WAIT_FOR_GDB
# define WAIT_FOR_GDB 0
#endif
#if WAIT_FOR_GDB
static void launchgdb() {
pid_t pid = getpid();
char inbuffer[10];
@ -31,13 +36,16 @@ static void launchgdb() {
}
}
}
#endif
void fault_handler(int sn, struct siginfo *si, void *ctx)
{
void *p = si->si_addr;
if (si->si_code != SEGV_ACCERR) { /*SEGV_MAPERR*/
printf("SIGSEGV fault on %p\n", p);
#if WAIT_FOR_GDB
launchgdb();
#endif
abort();
}

View File

@ -2035,6 +2035,7 @@ static Scheme_Object *raise_syntax_error(int argc, Scheme_Object *argv[])
while (SCHEME_PAIRP(extra_sources)) {
if (!SCHEME_STXP(SCHEME_CAR(extra_sources)))
break;
extra_sources = SCHEME_CDR(extra_sources);
}
if (!SCHEME_NULLP(extra_sources)) {
scheme_wrong_type("raise-syntax-error", "list of syntax", 4, argc, argv);