Skip to content

Commit adc946e

Browse files
committed
Revert simplification to make tests pass
1 parent 4a1fce9 commit adc946e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,23 @@ module SourceSinkInterpretationInput implements
306306
or
307307
// `syntacticQualBaseType`'s underlying type might be a struct type and `sse`
308308
// might refer to an embedded method or field.
309-
syntacticQualBaseType.getUnderlyingType().(StructType).hasEmbeddedField(targetType, _)
309+
exists(StructType st, Field field1, Field field2, int depth1, int depth2, Type t2 |
310+
st = syntacticQualBaseType.getUnderlyingType() and
311+
field1 = st.getFieldAtDepth(_, depth1) and
312+
field2 = st.getFieldAtDepth(_, depth2) and
313+
targetType = lookThroughPointerType(field1.getType()) and
314+
t2 = lookThroughPointerType(field2.getType()) and
315+
(
316+
field1 = field2
317+
or
318+
field2 =
319+
targetType.getUnderlyingType().(StructType).getFieldAtDepth(_, depth2 - depth1 - 1)
320+
)
321+
|
322+
sse.asEntity().(Method).getReceiverBaseType() = t2
323+
or
324+
sse.asEntity().(Field).getDeclaringType() = t2.getUnderlyingType()
325+
)
310326
)
311327
)
312328
}

0 commit comments

Comments
 (0)