about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.rs
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-01-13 22:30:49 +0100
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-01-13 23:47:38 +0100
commit56671cb35784f21430cc5b518263b6d03bfb7975 (patch)
treec504ad157811798598964b4b364576d6fe4e3c4a /src/test/codegen/stack-alloc-string-slice.rs
parente94a9f033eb79b3b4fb037722366644650e8e16c (diff)
downloadrust-56671cb35784f21430cc5b518263b6d03bfb7975.tar.gz
rust-56671cb35784f21430cc5b518263b6d03bfb7975.zip
Prefer GEP instructions over weird pointer casting
There are two places left where we used to only know the byte
size of/offset into an array and had to cast to i8 and back to get the
right addresses. But by now, we always know the sizes in terms of the
number of elements in the array. In fact we have to add an extra Mul
instruction so we can use the weird cast-to-u8 code. So we should really
just embrace our new knowledge and use simple GEPs to do the address
calculations.

Additionally, the pointer calculations in bind_subslice_pat don't handle
zero-sized types correctly, producing slices that point outside the
array that is being matched against. Using GEP fixes that as well.

Fixes #3729
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions