]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 45728] Detect changes in .VARIABLES more accurately.
authorPaul Smith <psmith@gnu.org>
Sun, 13 Mar 2016 22:13:00 +0000 (18:13 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 13 Mar 2016 22:23:20 +0000 (18:23 -0400)
commit9ae02b79167e66311d23979cf1433d76054b86f8
treebc04b60148e5918a5126689bc060d960f61a04e6
parent247b71e690708a529cf639e196815cbbbee077d7
[SV 45728] Detect changes in .VARIABLES more accurately.

For performance, we only recompute .VARIABLES when (a) it's expanded
and (b) when its value will change from a previous expansion.  To
determine (b) we were checking the number of entries in the hash
table which used to work until we started undefining entries: now if
you undefine and redefine the same number of entries in between
expanding .VARIABLES, it doesn't detect any change.  Instead, keep
an increasing change number.
* variables.c: Add variable_changenum.
(define_variable_in_set, merge_variable_sets): Increment
variable_changenum if adding a new variable to the global set.
(undefine_variable_in_set): Increment variable_changenum if
undefining a variable from the global set.
(lookup_special_var): Test variable_changenum not the hash table.
* tests/scripts/variables/special: Test undefining variables.
tests/scripts/variables/special
variable.c