]> git.lizzy.rs Git - rust.git/commit
Auto merge of #36321 - uweigand:enum-abi, r=eddyb
authorbors <bors@rust-lang.org>
Fri, 9 Sep 2016 02:15:50 +0000 (19:15 -0700)
committerGitHub <noreply@github.com>
Fri, 9 Sep 2016 02:15:50 +0000 (19:15 -0700)
commit1df64450ecf9d2c458b5789ef823203fcdbd60a9
treec7e948a1fe232729fa58901f5c0fca28d5b6659e
parent378195665cc365720c784752877d5b1242c38ed8
parentce3cecf116a2d691c53f37c1d257a416ecfd381b
Auto merge of #36321 - uweigand:enum-abi, r=eddyb

Follow target ABI sign-/zero-extension rules for enum types

While attempting to port Rust to s390x, I ran into an ABI violation
(that caused rust_eh_personality to be miscompiled, breaking unwinding).
The problem is that this function returns an enum type, which is
supposed to be sign-extended according to the s390x ABI.  However,
common code would ignore target sign-/zero-extension rules for any
types that do not satisfy is_integral(), which includes enums.

For the general case of Rust enum types, which map to structure types
with a discriminant, that seems correct.  However, in the special case
of simple enums that map directly to C enum types (i.e. LLVM integers),
this is incorrect; we must follow the target extension rules for those.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>