summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2013-12-14 00:40:05 +0000
committerFaisal Vali <faisalv@yahoo.com>2013-12-14 00:40:05 +0000
commitb7d369845fe03e330bafc9d7ae8c5f173e71a31b (patch)
tree80147063b79c23551fae4fdb7aa088bb53bffbc9 /lib/CodeGen/CodeGenFunction.cpp
parent191e9e3d710bf4d592ad06f1defd703b61166f69 (diff)
downloadclang-b7d369845fe03e330bafc9d7ae8c5f173e71a31b.tar.gz
clang-b7d369845fe03e330bafc9d7ae8c5f173e71a31b.tar.bz2
clang-b7d369845fe03e330bafc9d7ae8c5f173e71a31b.tar.xz
Quick-Fix pointer arithmetic when performing multi-D new-array initialization.
clang still doesn't emit the right llvm code when initializing multi-D arrays it seems. For e.g. the following code would still crash for me on Windows 7, 64 bit: auto f4 = new int[100][200][300]{{{1,2,3}, {4, 5, 6}}, {{10, 20, 30}}}; It seems that the final new loop that iterates through each outermost array and memsets it to zero gets confused with its final ptr arithmetic. This patch ensures that it converts the pointer to the allocated type (int [200][300]) before incrementing it (instead of using the base type: 'int'). Richard somewhat squeamishly approved the patch (as a quick fix to potentially make it into 3.4) - while exhorting for a more optimized fix in the future. http://llvm-reviews.chandlerc.com/D2398 Thanks Richard! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions