Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Bug 93 - Build fails on ARM with static assert 8u == 4u
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Feb 3, 2014
1 parent 18d67a9 commit 9cafc06
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions libphobos/libdruntime/gcc/deh.d
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,14 @@ else

struct d_exception_header
{
version (GNU_ARM_EABI_Unwinder)
{
// Nothing here yet.
}
else
{
// Cache handler details between Phase 1 and Phase 2.
int handlerSwitchValue;
ubyte *actionRecord;
ubyte *languageSpecificData;
_Unwind_Ptr catchTemp;
}

// The object being thrown. Like GCJ, the compiled code expects this to
// be immediately before the generic exception header.
// (See build_exception_object)
enum UNWIND_PAD = (Object.alignof < _Unwind_Exception.alignof)
? _Unwind_Exception.alignof - Object.alignof : 0;

// FIXME: padding should be aligned max for target.
// Because of a lack of __aligned__ style attribute, our object
// and the unwind object are the first two fields.
ubyte[UNWIND_PAD] pad;

Object object;
Expand All @@ -86,12 +74,26 @@ struct d_exception_header
_Unwind_Exception unwindHeader;

static assert(unwindHeader.offsetof - object.offsetof == object.sizeof);

version (GNU_ARM_EABI_Unwinder)
{
// Nothing here yet.
}
else
{
// Cache handler details between Phase 1 and Phase 2.
int handlerSwitchValue;
ubyte *actionRecord;
ubyte *languageSpecificData;
_Unwind_Ptr catchTemp;
}
}

private d_exception_header *
get_exception_header_from_ue(_Unwind_Exception *exc)
{
return cast(d_exception_header *)(exc + 1) - 1;
return cast(d_exception_header *)
(cast(void *) exc - d_exception_header.unwindHeader.offsetof);
}

// D doesn't define these, so they are private for now.
Expand Down

0 comments on commit 9cafc06

Please sign in to comment.