]> granicus.if.org Git - llvm/commit
[asan] Copy arguments passed by value into explicit allocas for ASan
authorVitaly Buka <vitalybuka@google.com>
Tue, 18 Jul 2017 22:28:03 +0000 (22:28 +0000)
committerVitaly Buka <vitalybuka@google.com>
Tue, 18 Jul 2017 22:28:03 +0000 (22:28 +0000)
commit191674ce22c5d71e6e3373289502904471a1251d
tree8bdf1d3a5b2e61a9eaf9289971f8ee74b4b0735b
parent0b89845991c079f935db388955fbc9535e98da68
[asan] Copy arguments passed by value into explicit allocas for ASan

  Summary:
  ASan determines the stack layout from alloca instructions. Since
arguments marked as "byval" do not have an explicit alloca instruction, ASan
does not produce red zones for them. This commit produces an explicit alloca
instruction and copies the byval argument into the allocated memory so that red
zones are produced.

  Submitted on behalf of @morehouse (Matt Morehouse)

  Reviewers: eugenis, vitalybuka

  Reviewed By: eugenis

  Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308387 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll [new file with mode: 0644]