about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-02-15 23:23:19 +0100
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-02-16 00:50:02 +0100
commit4808561c45df77b6a7f8721f22b2f1e324cbeb3d (patch)
treeadbd0ce91c44ee24e63ff29c2e1fab45b99668a8 /src/rustllvm/RustWrapper.cpp
parent342ab53bf858a89e418973ba3bfff55161c0b174 (diff)
downloadrust-4808561c45df77b6a7f8721f22b2f1e324cbeb3d.tar.gz
rust-4808561c45df77b6a7f8721f22b2f1e324cbeb3d.zip
Fix misoptimizations when matching against strings/slices
When matching against strings/slices, we call the comparison function
for strings, which takes two string slices by value. The slices are
passed in memory, and currently we just pass in a pointer to the
original slice. That can cause misoptimizations because we emit a call
to llvm.lifetime.end for all by-value arguments at the end of a
function, which in this case marks the original slice as dead.

So we need to properly create copies of the slices to pass them to the
comparison function.

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