Skip to content

Commit a41f394

Browse files
committed
Fix flow through pointer types related by aliasing
1 parent a0058c5 commit a41f394

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
153153
or
154154
node1 = base and
155155
node2.(PostUpdateNode).getPreUpdateNode() = node1.(PointerDereferenceNode).getOperand() and
156-
c = any(DataFlow::PointerContent pc | pc.getPointerType() = node2.getType())
156+
c =
157+
any(DataFlow::PointerContent pc | pc.getPointerType() = node2.getType().getDeepUnaliasedType())
157158
)
158159
or
159160
node1 = node2.(AddressOperationNode).getOperand() and
@@ -172,7 +173,8 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
172173
*/
173174
predicate readStep(Node node1, ContentSet c, Node node2) {
174175
node1 = node2.(PointerDereferenceNode).getOperand() and
175-
c = any(DataFlow::PointerContent pc | pc.getPointerType() = node1.getType())
176+
c =
177+
any(DataFlow::PointerContent pc | pc.getPointerType() = node1.getType().getDeepUnaliasedType())
176178
or
177179
exists(FieldReadNode read |
178180
node2 = read and

0 commit comments

Comments
 (0)