diff options
author | Colin Cross <ccross@android.com> | 2015-07-10 17:51:55 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-08-03 16:08:16 -0700 |
commit | 6d8780f724b092458aca76dd4ef9c9ff44570351 (patch) | |
tree | a1b393fa030c8abf12ed63c056f21513a804028f /context_test.go | |
parent | 0894cbc1a9f0564e77dfbe74ed09d03bc7eaf30d (diff) | |
download | android_build_blueprint-6d8780f724b092458aca76dd4ef9c9ff44570351.tar.gz android_build_blueprint-6d8780f724b092458aca76dd4ef9c9ff44570351.tar.bz2 android_build_blueprint-6d8780f724b092458aca76dd4ef9c9ff44570351.zip |
Fix bugs related to local vs. inherited variables
The Go race detector found a race condition in the parser, which
highlighted a few related bugs. A variable could be defined but
not referenced in a Blueprints file, then appended to in multiple
subdirs= Blueprints files. The race detector caught the multiple
writes to assignment.Referenced from the parsers for the subdirs
Blueprints files, but multiple appends would be much more serious.
To fix this, keep local and inherited variables separate in the
Scope object and export that info to the parser. Disallow
appending to non-local variables, which was already the intended
behavior. Only update the referenced boolean for local variables.
Together, this should prevent all writes to Assignment objects
from parsers other than the one that created them.
Also improves the error handling code and some error messages.
Change-Id: Idb4f7d2e61bbe28d90b93074764e64e60d1eba8f
Diffstat (limited to 'context_test.go')
0 files changed, 0 insertions, 0 deletions