Skip to content

Commit 05d69ef

Browse files
committed
Create opaque ptr
1 parent 2981926 commit 05d69ef

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/AST/Util.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,9 @@ clang::QualType DecompilationContext::GetQualType(llvm::Type *type) {
462462

463463
case llvm::Type::PointerTyID: {
464464
auto ptr_type{llvm::cast<llvm::PointerType>(type)};
465-
auto pointee_type = ptr_type->getContainedType(0);
466-
if (!pointee_type || pointee_type->isVoidTy()) {
467-
result = ast_ctx.VoidPtrTy;
468-
} else {
469-
result = ast_ctx.getPointerType(GetQualType(pointee_type));
470-
}
465+
// With opaque pointers, we can't get element type directly from the
466+
// pointer; Use the context's void pointer type as the default
467+
result = ast_ctx.VoidPtrTy;
471468
} break;
472469

473470
case llvm::Type::ArrayTyID: {

0 commit comments

Comments
 (0)