mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Ensure external class extractions without a VirtualFile are lowest priority
Previously by using major version 0 to represent the no-virtual-file case these got highest priority. This meant that a class extracted relating to a .java file seen by the Kotlin compiler, which necessarily lacks a useful source-location, was highest priority. Now that should get overwritten whenever anybody sees it in the form of a .class file, since this will have version information. This should in particular eliminate the case where a generic class is extracted with no useful source location (based on .java source), then generic instances are extracted with a useful source location (based on a .class source), but the location isn't in the database.
This commit is contained in:
committed by
Ian Lynagh
parent
613d81d231
commit
97d44d9583
@@ -552,7 +552,7 @@ public class OdasaOutput {
|
|||||||
sym.getParent() instanceof IrClass ? getIrClassVirtualFile((IrClass)sym.getParent()) :
|
sym.getParent() instanceof IrClass ? getIrClassVirtualFile((IrClass)sym.getParent()) :
|
||||||
null;
|
null;
|
||||||
if(vf == null)
|
if(vf == null)
|
||||||
return new TrapClassVersion(0, 0, 0, null);
|
return new TrapClassVersion(-1, 0, 0, null);
|
||||||
|
|
||||||
final int[] versionStore = new int[1];
|
final int[] versionStore = new int[1];
|
||||||
|
|
||||||
@@ -587,11 +587,11 @@ public class OdasaOutput {
|
|||||||
}
|
}
|
||||||
catch(IllegalAccessException e) {
|
catch(IllegalAccessException e) {
|
||||||
log.warn("Failed to read class file version information", e);
|
log.warn("Failed to read class file version information", e);
|
||||||
return new TrapClassVersion(0, 0, 0, null);
|
return new TrapClassVersion(-1, 0, 0, null);
|
||||||
}
|
}
|
||||||
catch(IOException e) {
|
catch(IOException e) {
|
||||||
log.warn("Failed to read class file version information", e);
|
log.warn("Failed to read class file version information", e);
|
||||||
return new TrapClassVersion(0, 0, 0, null);
|
return new TrapClassVersion(-1, 0, 0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private boolean isValid() {
|
private boolean isValid() {
|
||||||
|
|||||||
Reference in New Issue
Block a user