[asan_symbolize] Workaround bug in old Python 2 versions.
authorDan Liew <dan@su-root.co.uk>
Thu, 18 Apr 2019 16:22:55 +0000 (16:22 +0000)
committerDan Liew <dan@su-root.co.uk>
Thu, 18 Apr 2019 16:22:55 +0000 (16:22 +0000)
commit16c3883b9837b0541503e03b34fd690de974e814
tree9fd88bee1c579ffd111e71809e63d769007a5ae5
parent523f90a2bad9995e52e2f00dd42836c726076b5a
[asan_symbolize] Workaround bug in old Python 2 versions.

The change landed in r358657 broke some of the buildbots because they
use an older version of Python 2 that raises this error.

```
File "/Volumes/data/dev/llvm/upstream/master/src/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py", line 509
  exec(f.read(), globals_space, None)
SyntaxError: unqualified exec is not allowed in function 'load_plugin_from_file' it contains a nested function with free variables
```

I can reproduce this problem when using Python 2.7.6.

To workaround this some indirection has been added to prevent the broken
(the line at fault would never be executed) SyntaxError error in old
Python versions from being raised.

rdar://problem/49476995

llvm-svn: 358682
compiler-rt/lib/asan/scripts/asan_symbolize.py