Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit aade348

Browse files
Merge pull request #2714 from kinke/after2713
[stable] Follow-up on #2713
2 parents e18c21a + cd0ef3d commit aade348

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/rt/sections_osx_x86_64.d

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static immutable SegRef[] dataSegs = [{SEG_DATA, SECT_DATA},
173173
ubyte[] getSection(in mach_header* header, intptr_t slide,
174174
in char* segmentName, in char* sectionName)
175175
{
176-
assert(header.magic == MH_MAGIC_64);
176+
safeAssert(header.magic == MH_MAGIC_64, "Unsupported header.");
177177
auto sect = getsectbynamefromheader_64(cast(mach_header_64*)header,
178178
segmentName,
179179
sectionName);
@@ -185,7 +185,10 @@ ubyte[] getSection(in mach_header* header, intptr_t slide,
185185

186186
extern (C) size_t malloc_size(const void* ptr) nothrow @nogc;
187187

188-
/// Returns the TLS range of the current image.
188+
/**
189+
* Returns the TLS range of the image containing the specified TLS symbol,
190+
* or null if none was found.
191+
*/
189192
void[] getTLSRange(const void* tlsSymbol) nothrow @nogc
190193
{
191194
foreach (i ; 0 .. _dyld_image_count)
@@ -228,15 +231,13 @@ struct dyld_tlv_info
228231
/// Base address of TLV storage
229232
void* tlv_addr;
230233

231-
// Byte size of TLV storage
234+
/// Byte size of TLV storage
232235
size_t tlv_size;
233236
}
234237

235238
/**
236239
* Returns the TLV info for the given image.
237240
*
238-
* Asserts if no TLV address could be found.
239-
*
240241
* Params:
241242
* header = the image to look for the TLV info in
242243
*

src/rt/util/utility.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ module rt.util.utility;
1414
* Asserts that the given condition is `true`.
1515
*
1616
* The assertion is independent from -release, by abort()ing. Regular assertions
17-
* throw an AssertError and thus require an initialized GC, which isn't the case
18-
* (yet or anymore) for the startup/shutdown code in this module
17+
* throw an AssertError and thus require an initialized GC, which might not be
18+
* the case (yet or anymore) for the startup/shutdown code in this package
1919
* (called by CRT ctors/dtors etc.).
2020
*/
2121
package(rt) void safeAssert(
22-
bool condition, scope string msg, size_t line = __LINE__
22+
bool condition, scope string msg, scope string file = __FILE__, size_t line = __LINE__
2323
) nothrow @nogc @safe
2424
{
2525
import core.internal.abort;
26-
condition || abort(msg, __FILE__, line);
26+
condition || abort(msg, file, line);
2727
}

0 commit comments

Comments
 (0)