]> git.lizzy.rs Git - rust.git/commit
Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddyb
authorbors <bors@rust-lang.org>
Thu, 26 May 2016 09:52:49 +0000 (02:52 -0700)
committerbors <bors@rust-lang.org>
Thu, 26 May 2016 09:52:49 +0000 (02:52 -0700)
commit3c795e08d6f4a532f12f3f8e1837db5e0647f8b0
tree5d1cf1555506d6a4c8d3ab1ebbb43b092103848b
parentd5759a3417fa395d439f4283825504dd4f78dc87
parent5b404523dd1741681ba411c48c3df3c4cf5b22ab
Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddyb

Fix handling of FFI arguments

r? @eddyb @nikomatsakis or whoever else.

cc @alexcrichton @rust-lang/core

The strategy employed here was to essentially change code we generate from

```llvm
  %s = alloca %S ; potentially smaller than argument, but never larger
  %1 = bitcast %S* %s to { i64, i64 }*
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
```

to

```llvm
  %1 = alloca { i64, i64 } ; the copy of argument itself
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
  %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type.
```