[PATCH] D14972: [safestack] Protect byval function arguments.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 11:58:32 PST 2015


pcc added a comment.

That would break things, unfortunately. Consider this code:

  A *ptr;
  
  struct A {
    A() {
      ptr = this;
    }
  };
  
  void f(A a) {
   assert(ptr == &a);
  }
  
  void g() {
    f(A());
  }

If we make a copy of `a` in `f`, the assertion would fail.


Repository:
  rL LLVM

http://reviews.llvm.org/D14972





More information about the llvm-commits mailing list