Closed swift-ci closed 7 years ago
It's crashing in the remangler? Huh. @jckarter, something wrong with our Punycode implementation?
It looks like we fail to demangle the name somewhere too, since the first print doesn't show the correct type name either:
V4mainX63_IFJq()
Looks like we might be mangling incorrectly in the compiler, that should be X6C_IFJq
, not X63_IFJq
. The latter parses as a 63-byte identifier mangling, which is probably what's causing the crash.
Ah, the problem is that the first ASCII character in the identifier is a digit, so the ASCII prefix of the Punycode encoding butts up against the identifier length and produces the invalid mangling.
We customize the encoding so that the suffix alphabet doesn't contain digits, so we could flip the encoding so that the non-ASCII suffix goes first.
…or just give up on Punycode and encode UTF-8 directly; ELF and Mach-O both allow symbols to be arbitrary byte strings (though tools may or may not be UTF-8-clean).
I'd still rather not. It sounds like the encoding change would be trivial (and presumably unambiguous).
This is already fixed
Attachment: Download
Environment
Running El Capitan, with swiftc -v giving: Apple Swift version 2.2-dev (LLVM f90171f6b9, Clang fe39b0b18f, Swift a476c2828a) Target: x86_64-apple-macosx10.9 This should be January 25 development snapshot.Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, AffectsABI, Runtime | |Assignee | @jckarter | |Priority | Medium | md5: 3e8195014e753da557e682db8672516fIssue Description:
When naming a struct with a unicode math symbol (or at least one such symbol), the compiled code will crash when putting struct instances into an array. See attached code for an example.
swiftc compiles the attached code, and produces no warning or errors. Executing the binary gives:
Running the attached code directly with swift gives:
Note that the character used is:
MATHEMATICAL DOUBLE-STRUCK CAPITAL F
Unicode: U+1D53D, UTF-8: F0 9D 94 BD
Presumably the compiler should either emit an error if it is an unacceptable character, or generate not broken code.