[lld] r227504 - Add an assert to check atom ordinal.
Rui Ueyama
ruiu at google.com
Thu Jan 29 14:39:43 PST 2015
Author: ruiu
Date: Thu Jan 29 16:39:43 2015
New Revision: 227504
URL: http://llvm.org/viewvc/llvm-project?rev=227504&view=rev
Log:
Add an assert to check atom ordinal.
No two atoms are allowed to have the same file and atom ordinals.
If there's such atoms, there's a bug in the reader.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h
Modified: lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h?rev=227504&r1=227503&r2=227504&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h Thu Jan 29 16:39:43 2015
@@ -42,6 +42,7 @@ static bool compareByPosition(const Defi
const File *rhsFile = &rhs->file();
if (lhsFile->ordinal() != rhsFile->ordinal())
return lhsFile->ordinal() < rhsFile->ordinal();
+ assert(lhs->ordinal() != rhs->ordinal());
return lhs->ordinal() < rhs->ordinal();
}
More information about the llvm-commits
mailing list