diff --git a/go/extractor/extractor.go b/go/extractor/extractor.go index fa3f6b7c00d..b4d4815f15c 100644 --- a/go/extractor/extractor.go +++ b/go/extractor/extractor.go @@ -814,12 +814,12 @@ func (extraction *Extraction) extractFileInfo(tw *trap.Writer, file string, isDu displayPath = rawPath } if i == len(components)-1 { - lbl := tw.Labeler.FileLabelFor(file) + lbl := tw.Labeler.FileLabelFor(path) dbscheme.FilesTable.Emit(tw, lbl, displayPath) dbscheme.ContainerParentTable.Emit(tw, parentLbl, lbl) dbscheme.HasLocationTable.Emit(tw, lbl, emitLocation(tw, lbl, 0, 0, 0, 0)) extraction.Lock.Lock() - slbl := extraction.StatWriter.Labeler.FileLabelFor(file) + slbl := extraction.StatWriter.Labeler.FileLabelFor(path) if !isDummy { dbscheme.CompilationCompilingFilesTable.Emit(extraction.StatWriter, extraction.Label, extraction.GetFileIdx(file), slbl) } diff --git a/go/extractor/trap/labels.go b/go/extractor/trap/labels.go index 2822da61ff1..9a03bfe9a57 100644 --- a/go/extractor/trap/labels.go +++ b/go/extractor/trap/labels.go @@ -4,6 +4,7 @@ import ( "fmt" "go/types" + "github.com/github/codeql-go/extractor/srcarchive" "github.com/github/codeql-go/extractor/util" ) @@ -67,7 +68,7 @@ func (l *Labeler) GlobalID(key string) Label { // FileLabel returns the label for a file with path `path`. func (l *Labeler) FileLabel() Label { if l.fileLabel == InvalidLabel { - l.fileLabel = l.FileLabelFor(l.tw.path) + l.fileLabel = l.FileLabelFor(srcarchive.TransformPath(l.tw.path)) } return l.fileLabel }