Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Mar 2015 00:47:38 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r279456 - in stable: 10/contrib/libcxxrt 9/contrib/libcxxrt
Message-ID:  <201503010047.t210lcuH095256@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Mar  1 00:47:37 2015
New Revision: 279456
URL: https://svnweb.freebsd.org/changeset/base/279456

Log:
  MFC r279307:
  
  Make libcxxrt's parsing of DWARF exception handling tables work on
  architectures with strict alignment, by using memcpy() instead of
  directly reading fields.
  
  Reported by:	Daisuke Aoyama <aoyama@peach.ne.jp>
  Reviewed by:	imp, bapt
  Tested by:	bapt
  Differential Revision: https://reviews.freebsd.org/D1967
  
  MFC r279310:
  
  Since newer versions of compiler-rt require unwind.h, and we want to use
  the copy in libcxxrt for it, fix the arm-specific header to define the
  _Unwind_Action type.
  
  Submitted by:	andrew

Modified:
  stable/9/contrib/libcxxrt/dwarf_eh.h
  stable/9/contrib/libcxxrt/unwind-arm.h
Directory Properties:
  stable/9/contrib/libcxxrt/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/libcxxrt/dwarf_eh.h
  stable/10/contrib/libcxxrt/unwind-arm.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/contrib/libcxxrt/dwarf_eh.h
==============================================================================
--- stable/9/contrib/libcxxrt/dwarf_eh.h	Sun Mar  1 00:44:15 2015	(r279455)
+++ stable/9/contrib/libcxxrt/dwarf_eh.h	Sun Mar  1 00:47:37 2015	(r279456)
@@ -218,15 +218,17 @@ static int64_t read_sleb128(dw_eh_ptr_t 
 static uint64_t read_value(char encoding, dw_eh_ptr_t *data)
 {
 	enum dwarf_data_encoding type = get_encoding(encoding);
-	uint64_t v;
 	switch (type)
 	{
 		// Read fixed-length types
 #define READ(dwarf, type) \
 		case dwarf:\
-			v = static_cast<uint64_t>(*reinterpret_cast<type*>(*data));\
-			*data += sizeof(type);\
-			break;
+		{\
+			type t;\
+			memcpy(&t, *data, sizeof t);\
+			*data += sizeof t;\
+			return static_cast<uint64_t>(t);\
+		}
 		READ(DW_EH_PE_udata2, uint16_t)
 		READ(DW_EH_PE_udata4, uint32_t)
 		READ(DW_EH_PE_udata8, uint64_t)
@@ -237,15 +239,11 @@ static uint64_t read_value(char encoding
 #undef READ
 		// Read variable-length types
 		case DW_EH_PE_sleb128:
-			v = read_sleb128(data);
-			break;
+			return read_sleb128(data);
 		case DW_EH_PE_uleb128:
-			v = read_uleb128(data);
-			break;
+			return read_uleb128(data);
 		default: abort();
 	}
-
-	return v;
 }
 
 /**

Modified: stable/9/contrib/libcxxrt/unwind-arm.h
==============================================================================
--- stable/9/contrib/libcxxrt/unwind-arm.h	Sun Mar  1 00:44:15 2015	(r279455)
+++ stable/9/contrib/libcxxrt/unwind-arm.h	Sun Mar  1 00:47:37 2015	(r279456)
@@ -36,6 +36,8 @@
 	_URC_FATAL_PHASE1_ERROR = _URC_FAILURE
 } _Unwind_Reason_Code;
 
+typedef int _Unwind_Action;
+
 typedef uint32_t _Unwind_State;
 #ifdef __clang__
 static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME  = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503010047.t210lcuH095256>