[llvm-commits] [llvm] r142315 - in /llvm/trunk:include/llvm/Object/COFF.h lib/Object/COFFObjectFile.cpp

Michael Spencer bigcheesegs at gmail.com
Mon Oct 17 21:29:02 PDT 2011


On Mon, Oct 17, 2011 at 6:48 PM, Xu Zhongxing <xuzhongxing at foxmail.com> wrote:
>
> @@ -553,13 +544,32 @@
>
>  error_code COFFObjectFile::getSymbol(uint32_t index,
>                                       const coff_symbol *&Result) const {
> -  if (index > 0 && index < Header->NumberOfSymbols)
> +  if (index >= 0 && index < Header->NumberOfSymbols)
> Hi Michael, index is unsigned. It's always >= 0.

Thanks, didn't notice that while changing. The >= 0 was intended to
handle the -1 and -2 cases. The COFF standard doesn't specify if the
field is signed or unsigned, however, the tools seem to indicate that
it is unsigned, and only -1 and -2 have special meanings.

- Michael Spencer




More information about the llvm-commits mailing list