Ericsson / CodecheckerVSCodePlugin

VSCode plugin that shows bugs detected by the Clang Static Analyzer and Clang Tidy analyzers using CodeChecker as a backend.
Apache License 2.0
24 stars 7 forks source link

Navigating between reports of overlapping positions #86

Closed Discookie closed 2 years ago

Discookie commented 2 years ago

The following code segment is an example of overlapping positions.

main.cpp

#ifndef MAIN_H
#define MAIN_H

int foo(int param) {
  return param;
}

#endif

main.h

#include "main.h"

int main() {
  return 1 / foo(0);
}

List of reports for the code segment above

Here, 'Calling foo' and 'Returning from foo' have the exact same positions (where a 'Jump to repr. step' call goes) and ranges (what's displayed in the editor). Because the extension has no memory which step it's supposed to be on, stepping into foo from step 2 is impossible because the extension believes it's on step 5.

75 partially solves this by prioritizing the position when there are overlaps between different ranges, but the fix doesn't handle when multiple ranges have the same position.