Skip to content

Commit 2f79b05

Browse files
committed
---
yaml --- r: 341745 b: refs/heads/rxwei-patch-1 c: 2f8b5ac h: refs/heads/master i: 341743: a5b2615
1 parent 337260d commit 2f79b05

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 354eb4d7292951c34f2ba1e5f87a32e40c4a9f9b
1018+
refs/heads/rxwei-patch-1: 2f8b5ac9e2f4395f2633b0dfe03b7d6fd1685b7d
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/stdlib/public/runtime/Metadata.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "llvm/Support/PointerLikeTypeTraits.h"
3232
#include <algorithm>
3333
#include <cctype>
34+
#include <cinttypes>
3435
#include <condition_variable>
3536
#include <new>
3637
#include <unordered_set>
@@ -3897,10 +3898,15 @@ void _swift_debug_verifyTypeLayoutAttribute(Metadata *type,
38973898
size_t size,
38983899
const char *description) {
38993900
auto presentValue = [&](const void *value) {
3900-
if (size < sizeof(long long)) {
3901-
long long intValue = 0;
3902-
memcpy(&intValue, value, size);
3903-
fprintf(stderr, "%lld (%#llx)\n ", intValue, intValue);
3901+
if (size <= sizeof(uint64_t)) {
3902+
uint64_t intValue = 0;
3903+
auto ptr = reinterpret_cast<uint8_t *>(&intValue);
3904+
#if defined(__BIG_ENDIAN__)
3905+
ptr += sizeof(uint64_t) - size;
3906+
#endif
3907+
memcpy(ptr, value, size);
3908+
fprintf(stderr, "%" PRIu64 " (%#" PRIx64 ")\n", intValue, intValue);
3909+
fprintf(stderr, " ");
39043910
}
39053911
auto bytes = reinterpret_cast<const uint8_t *>(value);
39063912
for (unsigned i = 0; i < size; ++i) {

0 commit comments

Comments
 (0)