Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit eb639c6

Browse files
Sauyon LeeGitHub Enterprise
Sauyon Lee
authored and
GitHub Enterprise
committedDec 5, 2019
Merge pull request #196 from max/no-type
Make `Expr.getType()` robust against incomplete `type_of` table.
2 parents 8bd4559 + 8364ba3 commit eb639c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎ql/src/semmle/go/Expr.qll

+6-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ class Expr extends @expr, ExprParent {
102102
predicate isPlatformIndependentConstant() { none() }
103103

104104
/** Gets the type of this expression. */
105-
Type getType() { type_of(this, result) }
105+
Type getType() {
106+
type_of(this, result)
107+
or
108+
not type_of(this, _) and
109+
result instanceof InvalidType
110+
}
106111

107112
/**
108113
* Gets the global value number of this expression.

0 commit comments

Comments
 (0)
This repository has been archived.