[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/20642] internal error in get_section_contents, at icf.cc:467 w

From: Marco.Leise at gmx dot de
Subject: [Bug gold/20642] internal error in get_section_contents, at icf.cc:467 with --icf=safe
Date: Wed, 25 Apr 2018 00:33:39 +0000


--- Comment #13 from Marco Leise <Marco.Leise at gmx dot de> ---
(In reply to Cary Coutant from comment #12)
> Here's a disassembly of the first part of the function in section 150:
> Disassembly of section
> .text._D3std8encoding__T6decodeTAxEQBbQBa10Latin2CharZQBeFNaNbNiNfKQBjZw:
> [...]
> (Side question: where does this name mangling scheme come from? It's not the
> standard C++ scheme.)

That is Dlang mangling and means "pure nothrow @nogc @safe dchar
const(std.encoding.Latin2Char)[])", which is an instance of this
generic/template function:
instanced with this type (basically a #typedef ubyte):

It boils down to reading a character 'c' off the string and then translating it
through a lookup table to a UTF-16 code point:

    private static immutable dchar m_charMapStart = 0xa1;
    private static immutable dchar m_charMapEnd = 0xff;

    private immutable wstring charMap =

    return (c >= m_charMapStart && c <= m_charMapEnd) ?
charMap[c-m_charMapStart] : c;

There is a safety range check in place here. That's where the "cmp   
$0x5e,%ecx" comes from in the assembly before the table 'charMap' is indexed
and the heuristic fails.

You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]