Ticket #742: warning-from-jw-possibly-broken-savemstack.diff

File warning-from-jw-possibly-broken-savemstack.diff, 2.5 KB (added by felix winkelmann, 11 years ago)
  • runtime.c

    old new  
    17921792
    17931793void C_fcall C_callback_adjust_stack(C_word *a, int size)
    17941794{
    1795   if(!chicken_is_running && !C_in_stackp((C_word)a)) {
     1795  if(!chicken_is_running && !C_i_in_stackp((C_word)a)) {
    17961796    if(debug_mode)
    17971797      C_dbg(C_text("debug"),
    17981798            C_text("callback invoked in lower stack region - adjusting limits:\n"
     
    19661966
    19671967  key = hash_string(len, str, stable->size);
    19681968
    1969   if(C_truep(s = lookup(key, len, str, stable))) {
    1970     if(C_in_stackp(s)) C_mutate(slot, s);
    1971    
    1972     return s;
    1973   }
     1969  if(C_truep(s = lookup(key, len, str, stable)))
     1970    return C_mutate(slot, s);
    19741971
    19751972  s = C_static_string(C_heaptop, len, str);
    19761973  return add_symbol(C_heaptop, key, s, stable);
     
    21092106}
    21102107
    21112108
    2112 C_regparm int C_in_stackp(C_word x)
     2109C_inline C_regparm int C_i_in_stackp(C_word x)
    21132110{
    21142111  C_word *ptr = (C_word *)(C_uword)x;
    21152112
     
    21202117#endif
    21212118}
    21222119
     2120C_regparm int C_in_stackp(C_word x)
     2121{
     2122  return C_i_in_stackp(x);
     2123}
    21232124
    21242125C_regparm int C_fcall C_in_heapp(C_word x)
    21252126{
     
    25392540{
    25402541  unsigned int mssize, newmssize, bytes;
    25412542
    2542   if(!C_immediatep(val)) {
     2543  if(!C_immediatep(val) && C_i_in_stackp(val)) {
    25432544#ifdef C_GC_HOOKS
    25442545    if(C_gc_mutation_hook != NULL && C_gc_mutation_hook(slot, val)) return val;
    25452546#endif
     
    33623363        if(is_fptr(h))          /* forwarded? update l-table entry */
    33633364          loc = locative_table[ i ] = fptr_to_ptr(h);
    33643365        /* otherwise it must have been GC'd (since this is a minor one) */
    3365         else if(C_in_stackp(loc)) {
     3366        else if(C_i_in_stackp(loc)) {
    33663367          locative_table[ i ] = C_SCHEME_UNDEFINED;
    33673368          C_set_block_item(loc, 0, 0);
    33683369          ++invalidated;
     
    33793380          C_set_block_item(loc, 0, (C_uword)fptr_to_ptr(h) + offset);
    33803381          hi = i + 1;
    33813382        }
    3382         else if(C_in_stackp(obj)) { /* pointed-at object GC'd, locative is invalid */
     3383        else if(C_i_in_stackp(obj)) { /* pointed-at object GC'd, locative is invalid */
    33833384          locative_table[ i ] = C_SCHEME_UNDEFINED;
    33843385          C_set_block_item(loc, 0, 0);
    33853386        }
     
    79857986  flist->next = finalizer_list;
    79867987  finalizer_list = flist;
    79877988
    7988   if(C_in_stackp(x)) C_mutate(&flist->item, x);
     7989  if(C_i_in_stackp(x)) C_mutate(&flist->item, x);
    79897990  else flist->item = x;
    79907991
    7991   if(C_in_stackp(proc)) C_mutate(&flist->finalizer, proc);
     7992  if(C_i_in_stackp(proc)) C_mutate(&flist->finalizer, proc);
    79927993  else flist->finalizer = proc;
    79937994
    79947995  ++live_finalizer_count;