[clang] [clang][bytecode] Narrow allocated single-array Pointer (PR #147160)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 5 11:44:51 PDT 2025
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/147160
Since the result should not be an array element.
>From 231e1c5de7aef91d176da018fc44735bb62d76c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Sat, 5 Jul 2025 20:27:19 +0200
Subject: [PATCH] [clang][bytecode] Narrow allocated single-array Pointer
Since the result should not be an array element.
---
clang/lib/AST/ByteCode/InterpBuiltin.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index a73fc6c7bf2b3..1d6f444fb352c 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -1564,7 +1564,7 @@ static bool interp__builtin_operator_new(InterpState &S, CodePtr OpPC,
Block *B = Allocator.allocate(Desc, S.getContext().getEvalID(),
DynamicAllocator::Form::Operator);
assert(B);
- S.Stk.push<Pointer>(Pointer(B).atIndex(0));
+ S.Stk.push<Pointer>(Pointer(B).atIndex(0).narrow());
return true;
}
More information about the cfe-commits
mailing list