[llvm-bugs] [Bug 41498] New: Broken delta after invocation of RewriterBuffer::RemoveText() with removeLineIfEmpty==true

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 14 15:35:25 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41498

            Bug ID: 41498
           Summary: Broken delta after invocation of
                    RewriterBuffer::RemoveText() with
                    removeLineIfEmpty==true
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: other.nikita at mail.ru
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

It seems that real offset is used to update delta instead of original offset
(RewriterBuffer::RemoveText()):

if (posI != end() && *posI == '\n') {
  Buffer.erase(curLineStartOffs, lineSize + 1/* + '\n'*/);
  AddReplaceDelta(curLineStartOffs, -(lineSize + 1/* + '\n'*/));
}

Is it correct that the same offset is used in Buffer.erase() and
AddReplaceDelta()?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190414/6060bb00/attachment-0001.html>


More information about the llvm-bugs mailing list