pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:11828:    unsigned long hval;    if(!a || !b) return -1;    if(a==b) return 1;       hval = implements_hval(a->id,b->id);    if(implements_cache[hval].aid==a->id && implements_cache[hval].bid==b->id)    {    return implements_cache[hval].ret;    }    /* Do it the tedious way */ +  +  /* Invalidate the old entry at hval (if any). */ +  implements_cache[hval].aid = 0; +  implements_cache[hval].bid = 0; +  +  /* Note that it may be possible for low_implements() +  * to release the interpreter lock, so let it complete +  * before filling in the rest of the fields for the entry. +  * +  * Note also that cyclic calls are handled via low_implements(). +  */ +  implements_cache[hval].ret = low_implements(a,b);    implements_cache[hval].aid=a->id;    implements_cache[hval].bid=b->id; -  implements_cache[hval].ret = 1; /* Tentatively compatible. */ -  implements_cache[hval].ret = low_implements(a,b); +     /* NOTE: If low_implements() returns 0, the cache may have received    * some false positives. Those should be cleared.    */    return implements_cache[hval].ret;   }      /**    * @return Returns 1 if a is compatible with b.    */   static int low_is_compatible(struct program *a, struct program *b)
pike.git/src/program.c:11939:    }    rhval = implements_hval(bid,aid);    if(implements_cache[rhval].aid==bid &&    implements_cache[rhval].bid==aid &&    implements_cache[rhval].ret)    {    /* b implements a */    return 1;    }    /* Do it the tedious way */ +  +  /* Invalidate the old entry at hval (if any). */ +  is_compatible_cache[hval].aid = 0; +  is_compatible_cache[hval].bid = 0; +  +  /* Note that it may be possible for low_is_compatible() +  * to release the interpreter lock, so let it complete +  * before filling in the rest of the fields for the entry. +  * +  * Note also that cyclic calls are handled via low_is_compatible(). +  */ +  is_compatible_cache[hval].ret = low_is_compatible(a,b);    is_compatible_cache[hval].aid=aid;    is_compatible_cache[hval].bid=bid; -  is_compatible_cache[hval].ret = 1; /* Tentatively compatible. */ -  is_compatible_cache[hval].ret = low_is_compatible(a,b); +     /* NOTE: If low_is compatible() returns 0, the cache may have received    * some false positives. Those should be cleared.    */    return is_compatible_cache[hval].ret;   }      /**    * Explains why a is not compatible with b.    */   void yyexplain_not_compatible(int severity_level,