637039a7aa8106936f64b1d4748b19658fa9ccab |
|
02-Sep-2010 |
John McCall <rjmccall@apple.com> |
Abstract IR generation of array cookies into the C++ ABI class and implement ARM array cookies. Also fix a few unfortunate bugs: - throwing dtors in deletes prevented the allocation from being deleted - adding the cookie to the new[] size was not being considered for overflow (and, more seriously, was screwing up the earlier checks) - deleting an array via a pointer to array of class type was not causing any destructors to be run and was passing the unadjusted pointer to the deallocator - lots of address-space problems, in case anyone wants to support free store in a variant address space :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
75cf68a53f88924560663c0df1f513e422ae591b |
|
20-Jul-2010 |
Chris Lattner <sabre@nondot.org> |
don't demand names to be on IR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
ed67d7f7ae957406edf92c5fe541fc24dac6f235 |
|
20-Jul-2010 |
Chris Lattner <sabre@nondot.org> |
Follow the implementation approach suggested by PR6687, which generates more efficient and more obviously conformant code. We now test for overflow of the multiply then force the result to -1 if so. On X86, this generates nice code like this: __Z4testl: ## @_Z4testl ## BB#0: ## %entry subl $12, %esp movl $4, %eax mull 16(%esp) testl %edx, %edx movl $-1, %ecx cmovel %eax, %ecx movl %ecx, (%esp) call __Znam addl $12, %esp ret git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
08fe4c00ee3c2e62eb27acc38d13610d75b90b4a |
|
20-Jul-2010 |
Chris Lattner <sabre@nondot.org> |
implement rdar://5739832 - operator new should check for overflow in multiply, causing clang to compile this code into something that correctly throws a length error, fixing a potential integer overflow security attack: void *test(long N) { return new int[N]; } int main() { test(1L << 62); } We do this even when exceptions are disabled, because it is better for the code to abort than for the attack to succeed. This is heavily based on a patch that Fariborz wrote. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
4f4bd835ccc14c54177e9e7ad97bbdd09b161630 |
|
09-Apr-2010 |
John McCall <rjmccall@apple.com> |
Turn access control on by default in -cc1. Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
d8ebaa41846df288c8e9bb826bf36b14aa8199c7 |
|
17-Dec-2009 |
Nuno Lopes <nunoplopes@sapo.pt> |
revert part of my last patch, and mark only the c++ global new operator as noalias. the rest will be infered by llvm optz git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|
2186f97cb2706eb3bf26b0f5c943e228e4055593 |
|
16-Dec-2009 |
Nuno Lopes <nunoplopes@sapo.pt> |
implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators. feel free to chage the name to this lengthy argument git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/operator-new.cpp
|