mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Change file signature to something non-ASCII.
Based on feedback by Doug. This signature is fairly arbitrary: it's the UTF-8 encoding of U+2828 SPARKLES, followed by the number 14 to represent 2014. (Hopefully the format will have stabilized by 2014.) (Why not 0x00 or 0x01 for the last byte? Because it's more likely we'll collide with someone else being cute. Why not 0x0D / 13? Because that's \r and could conceivably appear in real Unicode text. No one uses 0x0E these days.) Swift SVN r5134
This commit is contained in:
@@ -104,8 +104,7 @@ Module *SerializedModuleLoader::loadModule(
|
||||
}
|
||||
|
||||
assert(inputFile);
|
||||
if (inputFile->getBufferSize() < 4 ||
|
||||
!inputFile->getBuffer().startswith(serialization::Signature)) {
|
||||
if (!inputFile->getBuffer().startswith(serialization::SIGNATURE)) {
|
||||
// FIXME: Diagnose malformed module? Right now we silently skip it and
|
||||
// continue searching.
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user