about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-04-18 23:29:57 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-04-18 23:29:57 +0530
commit4afd45e5b3bcd159153d1e66e4368cf8f6cbe46d (patch)
tree5c87d142560e9a901778e68c0f31e569da030369 /src/rustllvm/ExecutionEngineWrapper.cpp
parent514e06d65dd0d7097dea36abe8d46f0b03ba2663 (diff)
parent78745a4afe90fc5f24b9fa3af6a31551859419f8 (diff)
downloadrust-4afd45e5b3bcd159153d1e66e4368cf8f6cbe46d.tar.gz
rust-4afd45e5b3bcd159153d1e66e4368cf8f6cbe46d.zip
Rollup merge of #24472 - dotdash:23431, r=nikomatsakis
Loading from and storing to small aggregates happens by casting the
aggregate pointer to an appropriately sized integer pointer to avoid
the usage of first class aggregates which would lead to less optimized
code.

But this means that, for example, a tuple of type (i16, i16) will be
loading through an i32 pointer and because we currently don't provide
alignment information LLVM assumes that the load should use the ABI
alignment for i32 which would usually be 4 byte alignment. But the
alignment requirement for the (i16, i16) tuple will usually be just 2
bytes, so we're overestimating alignment, which invokes undefined
behaviour.

Therefore we must emit appropriate alignment information for
stores/loads through such casted pointers.

Fixes #23431
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions