Skip to content

Commit ea1b0a8

Browse files
committed
Rust: Fix path resolution for raw pointer types
1 parent c15e12c commit ea1b0a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

rust/ql/lib/codeql/rust/internal/PathResolution.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,11 @@ private TypeItemNode resolveBuiltin(TypeRepr tr) {
774774
tr instanceof RefTypeRepr and
775775
result instanceof Builtins::RefType
776776
or
777-
tr instanceof PtrTypeRepr and
778-
result instanceof Builtins::PtrType
777+
tr.(PtrTypeRepr).isConst() and
778+
result instanceof Builtins::PtrConstType
779+
or
780+
tr.(PtrTypeRepr).isMut() and
781+
result instanceof Builtins::PtrMutType
779782
or
780783
result.(Builtins::TupleType).getArity() = tr.(TupleTypeRepr).getNumberOfFields()
781784
}

rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ multipleCallTargets
1111
| main.rs:2642:13:2642:31 | ...::from(...) |
1212
| main.rs:2643:13:2643:31 | ...::from(...) |
1313
| main.rs:2644:13:2644:31 | ...::from(...) |
14-
multiplePathResolutions
15-
| main.rs:1818:26:1818:33 | <...> |
16-
| main.rs:1819:17:1819:26 | <...> |

0 commit comments

Comments
 (0)