From 09a9d673322ebf4ca2fcb7d48f13a44e015ea33f Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 9 Dec 2024 04:48:03 -0800 Subject: Allow pointers to existential values. (#5793) * Fix pointer offset logic and add executable tests. * Fix. * Fix test. * Add existential ptr test. * Allow pointers to existential values. * Fix. * Fix. --------- Co-authored-by: Ellie Hermaszewska --- source/slang/slang-check-type.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-type.cpp') diff --git a/source/slang/slang-check-type.cpp b/source/slang/slang-check-type.cpp index d9691a828..2c8f3d0c0 100644 --- a/source/slang/slang-check-type.cpp +++ b/source/slang/slang-check-type.cpp @@ -216,9 +216,10 @@ bool isManagedType(Type* type) { if (auto declRefValueType = as(type)) { - if (as(declRefValueType->getDeclRef().getDecl())) + auto decl = declRefValueType->getDeclRef().getDecl(); + if (as(decl)) return true; - if (as(declRefValueType->getDeclRef().getDecl())) + if (as(decl) && decl->findModifier()) return true; } return false; -- cgit v1.2.3