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

Commit 8364ba3

Browse files
author
Max Schaefer
committed
Make Expr.getType() robust against incomplete type_of table.
1 parent 8bd4559 commit 8364ba3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ql/src/semmle/go/Expr.qll

Lines changed: 6 additions & 1 deletion
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)