Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uptrans: always use a memcpy for ABI argument/return casts. #34141
Conversation
rust-highfive
assigned
nrc
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
added
the
beta-nominated
label
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
nikomatsakis
reviewed
Jun 7, 2016
|
|
||
| // We instead thus allocate some scratch space... | ||
| let llscratch = AllocaFcx(bcx.fcx(), ty, "abi_cast"); | ||
| base::Lifetime::End.call(bcx, llscratch); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eddyb
force-pushed the
eddyb:trans-abi-memcpy
branch
from
d43abf6
to
2e68f31
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r+ p=1 |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I'm inclined to beta-accept -- thoughts from @rust-lang/compiler team? |
This comment has been minimized.
This comment has been minimized.
|
I’m fine with it. My fix wasn’t supposed to be more than a short-term quick-hack anyway (for certain time-pressing reasons like trains rolling over the next day). EDIT: or rather, please do accept it. |
eddyb
force-pushed the
eddyb:trans-abi-memcpy
branch
from
2e68f31
to
0d145c9
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
+1 on the backport |
dotdash
reviewed
Jun 7, 2016
| }) | ||
| impl Lifetime { | ||
| pub fn call(self, b: &Builder, ptr: ValueRef) { | ||
| core_lifetime_emit(b.ccx, ptr, Lifetime::Start, |ccx, size, lifetime_intrinsic| { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Yep, that's much closer (not sure if 100% the same) to what I had in mind. Sorry for not getting that done myself earlier and causing some unnecessary churn :-/ That should also be useful for the outstanding transmute fix of mine that's still missing its MIR part. Nice! |
eddyb
force-pushed the
eddyb:trans-abi-memcpy
branch
from
0d145c9
to
d9f93b9
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=nikomatsakis |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Real failure:
Difference: |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 Who needs 32-bit anyway /s. |
eddyb
force-pushed the
eddyb:trans-abi-memcpy
branch
from
d9f93b9
to
e252865
Jun 7, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=nikomatsakis |
This comment has been minimized.
This comment has been minimized.
|
|
eddyb commentedJun 7, 2016
When storing incoming arguments or values returned by call/invoke, always do a
memcpyfrom a temporary of the cast type, if there is an ABI cast.While Clang has gotten smarter (store vs memcpy), a
memcpywill always work.This is what @dotdash has wanted to do all along, and it fixes #32049.