Branch: Tag:

2014-02-25

2014-02-25 14:37:35 by Per Hedbor <ph@opera.com>

Restored FIND_LFUN to work with all lfuns.

Also make the debug code conditional on PIKE_DEBUG.

It is now possible to use F_LOOKUP_LFUN again for all lfuns, not only
'real' ones.

104:   #define NUM_LFUNS 45      /* NOTE: After this point there are only fake lfuns. -  * ie use low_find_lfun(), and NOT FIND_LFUN()! +     */   #define LFUN__SEARCH 45   #define LFUN__TYPES 46
1069:   /* Prototypes end here */      static INLINE int FIND_LFUN(struct program * p, int lfun) { + #ifdef PIKE_DEBUG    dmalloc_touch(struct program*, p); -  if (lfun < 0 || lfun >= NUM_LFUNS) return find_lfun_fatal(p, lfun); -  -  if (p->flags & PROGRAM_FIXED) return p->lfuns[lfun]; +  if (lfun < 0) return find_lfun_fatal(p, lfun); + #endif +  if (p->flags & PROGRAM_FIXED && lfun < NUM_LFUNS) return p->lfuns[lfun];    return low_find_lfun(p, lfun);   }