This is an archive of the discontinued LLVM Phabricator instance.

[asan, myriad] Support environment variables
ClosedPublic

Authored by waltl on Jun 8 2018, 2:55 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

waltl created this revision.Jun 8 2018, 2:55 PM
alekseyshl added inline comments.Jun 11 2018, 11:31 AM
compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc
257 ↗(On Diff #150576)

What if name_len > env_len - 2?

261 ↗(On Diff #150576)

name == "" and env="=x\0" will work and return "x", but maybe it's not that a bad thing.

vitalybuka added inline comments.Jun 11 2018, 11:34 AM
compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc
39 ↗(On Diff #150576)

why?

41 ↗(On Diff #150576)

Howe about making it static and add __sanitizer::SetEnvForTest()

253 ↗(On Diff #150576)

how this can happen?

259 ↗(On Diff #150576)

for (uptr i = 0; i <= end; i += internal_strlen(env) + 1)

waltl updated this revision to Diff 150892.Jun 11 2018, 10:15 PM

Sorry for the overly complicated initial patch. We've decided to get
setenv() to work in our test enviroment (using similar approach to the
initial patch here), so now the sanitizer run-time can just call that.

waltl edited the summary of this revision. (Show Details)Jun 12 2018, 9:10 AM
alekseyshl accepted this revision.Jun 12 2018, 11:24 AM
This revision is now accepted and ready to land.Jun 12 2018, 11:24 AM
This revision was automatically updated to reflect the committed changes.