Skip to content

Commit a19cd80

Browse files
committed
ty: Use canonical type to access pointee.
Using the canonical type fixes this but changes the output of some tests (in particular, pointer to typedefs now point to the underlying type). That seems somewhat acceptable tho, and shouldn't be a correctness regression (so this patch should be a correctness improvement). Fixes #2244
1 parent 105b942 commit a19cd80

17 files changed

+41
-26
lines changed

src/ir/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ impl Type {
10311031
CXType_ObjCObjectPointer |
10321032
CXType_MemberPointer |
10331033
CXType_Pointer => {
1034-
let pointee = ty.pointee_type().unwrap();
1034+
let pointee = canonical_ty.pointee_type().unwrap();
10351035
let inner =
10361036
Item::from_ty_or_ref(pointee, location, None, ctx);
10371037
TypeKind::Pointer(inner)

tests/expectations/tests/call-conv-typedef.rs

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/class_with_typedef.rs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/const_resolved_ty.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/constify-module-enums-basic.rs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/constify-module-enums-simple-alias.rs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/constify-module-enums-types.rs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/convert-cpp-comment-to-rust.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/elaborated.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/issue-493.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/issue-493_1_0.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/layout_cmdline_token.rs

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/layout_eth_conf.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/layout_eth_conf_1_0.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/nsBaseHashtable.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/pointer-attr.rs

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/headers/pointer-attr.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void a(const char __attribute__((btf_type_tag("a"))) *);

0 commit comments

Comments
 (0)