[clang] [clang][bytecode][NFC] Reject invalid FromTypes in emitBuiltinBitcast (PR #118274)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 01:39:20 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

instead of silently accepting them and failing later.

---
Full diff: https://github.com/llvm/llvm-project/pull/118274.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Compiler.cpp (+2) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index f4cc284dfb6abf..78e76ff01b0f3e 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -6514,6 +6514,8 @@ bool Compiler<Emitter>::emitBuiltinBitCast(const CastExpr *E) {
       return false;
     if (!this->emitGetPtrLocal(TempOffset, E))
       return false;
+  } else {
+    return false;
   }
 
   if (!ToT || ToT == PT_Ptr) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/118274


More information about the cfe-commits mailing list