Skip to content

Commit 18db525

Browse files
GeekMasherowen-mc
andauthored
Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <[email protected]>
1 parent 3a1e3f7 commit 18db525

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

go/ql/lib/semmle/go/frameworks/GoMicro.qll

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ module GoMicro {
3535
*/
3636
class ProtocMessageType extends Type {
3737
ProtocMessageType() {
38-
exists(TypeEntity te |
39-
te.getType() = this and
40-
te.getDeclaration().getLocation().getFile() instanceof ProtocGeneratedFile and
41-
exists(MethodDecl md |
42-
md.getName() = "ProtoMessage" and
43-
this = md.getReceiverType().(PointerType).getBaseType()
44-
)
38+
this.hasLocationInfo(any(ProtocGeneratedFile f).getAbsolutePath(), _, _, _, _) and
39+
exists(MethodDecl md |
40+
md.getName() = "ProtoMessage" and
41+
this = md.getReceiverDecl().getTypeExpr().getAChild().(TypeName).getType()
4542
)
4643
}
4744

0 commit comments

Comments
 (0)