[clang] [clang][wasm] Resolve assertion errors caused by converting ComplexTy… (PR #70496)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 27 12:16:57 PDT 2023
https://github.com/knightXun updated https://github.com/llvm/llvm-project/pull/70496
>From e0ce1bab37de863d32d5d2e9b97f8bc345ef9ad9 Mon Sep 17 00:00:00 2001
From: xuknight <badgangkiller at gmail.com>
Date: Sat, 28 Oct 2023 02:52:43 +0800
Subject: [PATCH] [clang][wasm] Resolve assertion errors caused by converting
ComplexType to RecordType
When a function parameter is of the built-in Complex type in Clang,
the conversion from ComplexType to RecordType is not possible, resulting in a crash in Clang.
RecordType is a helper class for structs, unions, and classes.
---
clang/lib/CodeGen/Targets/WebAssembly.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/clang/lib/CodeGen/Targets/WebAssembly.cpp b/clang/lib/CodeGen/Targets/WebAssembly.cpp
index bd332228ce5bbe6..b3f6473eb9bc74c 100644
--- a/clang/lib/CodeGen/Targets/WebAssembly.cpp
+++ b/clang/lib/CodeGen/Targets/WebAssembly.cpp
@@ -114,6 +114,9 @@ ABIArgInfo WebAssemblyABIInfo::classifyArgumentType(QualType Ty) const {
return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0)));
// For the experimental multivalue ABI, fully expand all other aggregates
if (Kind == WebAssemblyABIKind::ExperimentalMV) {
+ if (Ty->getAs<ComplexType>()) {
+ return ABIArgInfo::getDirect();
+ }
const RecordType *RT = Ty->getAs<RecordType>();
assert(RT);
bool HasBitField = false;
More information about the cfe-commits
mailing list