summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse.llvm@gmail.com>2018-06-05 09:18:26 +0000
committerJeremy Morse <jeremy.morse.llvm@gmail.com>2018-06-05 09:18:26 +0000
commit8129c5c0a4eaf202a04d086e56c9f3646fd03721 (patch)
treef3a3bd3719dc81e5b188c3b89423df5393a90a85 /llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
parenta998f98ba63fbd7759aadb12eafa89aa8f83392c (diff)
downloadbcm5719-llvm-8129c5c0a4eaf202a04d086e56c9f3646fd03721.tar.gz
bcm5719-llvm-8129c5c0a4eaf202a04d086e56c9f3646fd03721.zip
Detect an incompatible VLA pointer assignment
For pointer assignments of VLA types, Clang currently detects when array dimensions _lower_ than a variable dimension differ, and reports a warning. However it does not do the same when the _higher_ dimensions differ, a case that GCC does catch. These two pointer types int (*foo)[1][bar][3]; int (*baz)[1][2][3]; are compatible with each another, and the program is well formed if bar == 2, a matter that is the programmers problem. However the following: int (*qux)[2][2][3]; would not be compatible with either, because the upper dimension differs in size. Clang reports baz is incompatible with qux, but not that foo is incompatible with qux because it doesn't check those higher dimensions. Fix this by comparing array sizes on higher dimensions: if both are constants but unequal then report incompatibility; if either dimension is variable then we can't know either way. Differential Revision: https://reviews.llvm.org/D47628 llvm-svn: 333989
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud