Skip to content

Commit f4e920c

Browse files
committed
Address review comments
1 parent b13df1f commit f4e920c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

go/extractor/util/subst_windows.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ func init() {
3030
}
3131
p, err := d.FindProc("resolve_subst")
3232
if err != nil {
33+
d.Release()
34+
return
35+
}
36+
f, err := d.FindProc("resolve_subst_free")
37+
if err != nil {
38+
d.Release()
3339
return
3440
}
35-
f, _ := d.FindProc("resolve_subst_free")
3641
dll = d
3742
procResolve = p
3843
procFree = f

java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class SubstResolver {
1818
boolean loaded = false;
1919
if (File.separatorChar == '\\') {
2020
String dist = System.getenv("CODEQL_DIST");
21-
if (dist != null && !dist.isEmpty()) {
21+
if (dist != null && !dist.isEmpty()) {
2222
try {
2323
Path library = Paths.get(dist).resolve("tools")
2424
.resolve("win64").resolve("canonicalize.dll").toAbsolutePath();
@@ -61,7 +61,12 @@ public static File resolve(File f) {
6161
return f;
6262
}
6363

64-
String resolved = nativeResolveSubst(path.substring(0, 3));
64+
String resolved;
65+
try {
66+
resolved = nativeResolveSubst(path.substring(0, 3));
67+
} catch (UnsatisfiedLinkError ignored) {
68+
return f;
69+
}
6570
if (resolved == null) {
6671
return f;
6772
}

0 commit comments

Comments
 (0)