[sanitizer_common] Fix sha2 interceptors not to use vars in array len
authorMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:22:14 +0000 (17:22 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:22:14 +0000 (17:22 +0000)
commit0f71c17e7c5e791168930e0f936d4fbe604f1d3c
treed9afab766ac9caf2e9475ccaf265c44ff30dec53
parentce28791e20e8a88581723da3eeb4b72695295f3e
[sanitizer_common] Fix sha2 interceptors not to use vars in array len

Fix the sha2 interceptor macros to use a constant for array parameter
length rather than referencing the extern variable.  Since the digest
length is provided in hash name, reuse the macro parameter for it.
Verify that the calculated value matches the one provided by system
headers.

Differential Revision: https://reviews.llvm.org/D55811

llvm-svn: 349645
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc