[llvm] [libunwind] r207467 misprint

Hi Nick!

In r207467 you added code(libunwind: DwarfInstructions.hpp):

assert(lastReg <= (int)cieInfo.returnAddressRegister
&& “register range does not contain return address register”);
for (int i = 0; i <= lastReg; ++i) {

else if (i == (int)cieInfo.returnAddressRegister)

There is misprint here: lastReg should be >= (int)cieInfo.returnAddressRegister in assert.

So patch is:

Index: DwarfInstructions.hpp

DwarfInstructions.hpp.patch (659 Bytes)


It looks like those asserts were added by Dan Albert.

225187 danalbert assert((int)CFI_Parser::kMaxRegisterNumber > lastReg &&
225187 danalbert “register range too large”);
225187 danalbert assert(lastReg <= (int)cieInfo.returnAddressRegister &&
225187 danalbert “register range does not contain return address register”);

The assert for the return register is complicated because stack based calling conventions (like x86[_64]) don’t have a register for the return value. Instead the dwarf makes up a number (x86 uses 8) for the return address number. This assert happens to work as-is for x86[_64] because the return register number == lastReg.


Looks like my change to that line was just a drive-by reformatting from r225187. The assert was added in r207467.