diff options
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -232,12 +232,12 @@ enum { }; #define NUMPARAM_ID_P(id) numparam_id_p(id) -#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1) -#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1)) +#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - (tNUMPARAM_1 - 1)) +#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 - 1 + (idx))) static int numparam_id_p(ID id) { - if (!is_local_id(id)) return 0; + if (!is_local_id(id) || id < (tNUMPARAM_1 << ID_SCOPE_SHIFT)) return 0; unsigned int idx = NUMPARAM_ID_TO_IDX(id); return idx > 0 && idx <= NUMPARAM_MAX; } |