[clang] [Codegen] Initialize RValue IsVolatile field in constructor (PR #195556)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 15:28:58 PDT 2026


https://github.com/shafik created https://github.com/llvm/llvm-project/pull/195556

Static analysis flagged that in some cases IsVolatile is left uninitialzed. I adjusted the constructor to initialize IsVolatile.

>From 667b68ce82fa2fe2fd73544c0fd608fde5664606 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Sun, 3 May 2026 15:25:39 -0700
Subject: [PATCH] [Codegen] Initialize RValue IsVolatile field in constructor

Static analysis flagged that in some cases IsVolatile is left uninitialzed.
I adjusted the constructor to initialize IsVolatile.
---
 clang/lib/CodeGen/CGValue.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index 373ea55147404..118ed6690627c 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/lib/CodeGen/CGValue.h
@@ -59,7 +59,7 @@ class RValue {
   unsigned Flavor : 2;
 
 public:
-  RValue() : Vals{nullptr, nullptr}, Flavor(Scalar) {}
+  RValue() : Vals{nullptr, nullptr}, IsVolatile(false), Flavor(Scalar) {}
 
   bool isScalar() const { return Flavor == Scalar; }
   bool isComplex() const { return Flavor == Complex; }



More information about the cfe-commits mailing list