Skip to content

Commit b008f98

Browse files
committed
Fix missing getUnderlyingType() calls
In both cases we also care about named types whose underlying type is an integer type.
1 parent 5dbb91f commit b008f98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/ql/lib/semmle/go/security/IncorrectIntegerConversionLib.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class TypeAssertionCheck extends DataFlow::ExprNode, FlowStateTransformer {
422422
TypeAssertionCheck() {
423423
exists(TypeAssertExpr tae |
424424
this = DataFlow::exprNode(tae.getExpr()) and
425-
it = tae.getTypeExpr().getType()
425+
it = tae.getTypeExpr().getType().getUnderlyingType()
426426
)
427427
}
428428

@@ -442,7 +442,7 @@ class TypeSwitchVarFlowStateTransformer extends DataFlow::SsaNode, FlowStateTran
442442
TypeSwitchVarFlowStateTransformer() {
443443
exists(IR::TypeSwitchImplicitVariableInstruction insn, LocalVariable lv | insn.writes(lv, _) |
444444
this.getSourceVariable() = lv and
445-
it = lv.getType()
445+
it = lv.getType().getUnderlyingType()
446446
)
447447
}
448448

0 commit comments

Comments
 (0)