aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-04-22 16:50:42 +0200
committerGitHub <noreply@github.com>2025-04-22 16:50:42 +0200
commitc2ae5723b5418fa0f5901f2c21c2c905fa48a498 (patch)
treec46a4273c12715cba6a8f5301a1b3bc30c6938a9 /clang/lib/AST/ByteCode/Compiler.cpp
parent980531cac0988e509425e64fbd279ee98e25307c (diff)
downloadllvm-c2ae5723b5418fa0f5901f2c21c2c905fa48a498.zip
llvm-c2ae5723b5418fa0f5901f2c21c2c905fa48a498.tar.gz
llvm-c2ae5723b5418fa0f5901f2c21c2c905fa48a498.tar.bz2
[clang][bytecode] Allow reinterpret casts from/to the same pointer type (#136692)
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 3e53f2a..7cba0e8 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -2990,6 +2990,8 @@ bool Compiler<Emitter>::VisitCXXReinterpretCastExpr(
if (PointeeToT && PointeeFromT) {
if (isIntegralType(*PointeeFromT) && isIntegralType(*PointeeToT))
Fatal = false;
+ } else {
+ Fatal = SubExpr->getType().getTypePtr() != E->getType().getTypePtr();
}
if (!this->emitInvalidCast(CastKind::Reinterpret, Fatal, E))