[llvm-symbolizer][native-pdb] Don't reset CurLineOffset if NextLineOffset is none

This commit is contained in:
Zequan Wu 2022-04-27 16:05:09 -07:00
parent 7762a3ce18
commit 1043eeaf86
1 changed files with 7 additions and 4 deletions

View File

@ -106,8 +106,8 @@ void NativeInlineSiteSymbol::getLineOffset(uint32_t OffsetInFunc,
uint32_t CodeOffset = 0;
Optional<uint32_t> CodeOffsetBase;
Optional<uint32_t> CodeOffsetEnd;
Optional<uint32_t> CurLineOffset;
Optional<uint32_t> NextLineOffset;
Optional<int32_t> CurLineOffset;
Optional<int32_t> NextLineOffset;
Optional<uint32_t> NextFileOffset;
auto UpdateCodeOffset = [&](uint32_t Delta) {
if (!CodeOffsetBase)
@ -138,9 +138,12 @@ void NativeInlineSiteSymbol::getLineOffset(uint32_t OffsetInFunc,
// Set base, end, file offset and line offset for next range.
if (NextFileOffset)
FileOffset = *NextFileOffset;
CurLineOffset = NextLineOffset ? NextLineOffset : None;
if (NextLineOffset) {
CurLineOffset = NextLineOffset;
NextLineOffset = None;
}
CodeOffsetBase = CodeOffsetEnd;
CodeOffsetEnd = NextLineOffset = NextFileOffset = None;
CodeOffsetEnd = NextFileOffset = None;
}
return false;
};