Ignore:
Timestamp:
Feb 1, 2015, 6:12:37 PM (10 years ago)
Author:
bird
Message:

string expansion debugged and enabled. fixed access-after-alloc bug in func_sort and could lead to heap corruption.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/variable.h

    r2769 r2770  
    116116#endif
    117117#if defined (CONFIG_WITH_COMPILER) || defined (CONFIG_WITH_MAKE_STATS)
    118     unsigned int evalval_count; /* Times used with $(evalval ) or $(evalctx ). */
    119     unsigned int expand_count;  /* Times expanded (not to be confused with exp_count). */
     118    unsigned int evalval_count; /* Times used with $(evalval ) or $(evalctx ) since last change. */
     119    unsigned int expand_count;  /* Times expanded since last change (not to be confused with exp_count). */
    120120#endif
    121121#ifdef CONFIG_WITH_COMPILER
     
    124124#endif
    125125  };
     126
     127/* Update statistics and invalidates optimizations when a variable changes. */
     128#ifdef CONFIG_WITH_COMPILER
     129# define VARIABLE_CHANGED(v) \
     130  do { \
     131      MAKE_STATS_2((v)->changes++); \
     132      if ((v)->evalprog || (v)->expandprog) kmk_cc_variable_changed(v); \
     133      (v)->expand_count = 0; \
     134      (v)->evalval_count = 0; \
     135    } while (0)
     136#else
     137# define VARIABLE_CHANGED(v) MAKE_STATS_2((v)->changes++)
     138#endif
     139
     140
    126141
    127142/* Structure that represents a variable set.  */
Note: See TracChangeset for help on using the changeset viewer.