diff --git a/ql/src/semmle/go/Expr.qll b/ql/src/semmle/go/Expr.qll index 7b9d84f48e8..36729f67396 100644 --- a/ql/src/semmle/go/Expr.qll +++ b/ql/src/semmle/go/Expr.qll @@ -102,7 +102,12 @@ class Expr extends @expr, ExprParent { predicate isPlatformIndependentConstant() { none() } /** Gets the type of this expression. */ - Type getType() { type_of(this, result) } + Type getType() { + type_of(this, result) + or + not type_of(this, _) and + result instanceof InvalidType + } /** * Gets the global value number of this expression.