[clang] 83401ed - [clang][bytecode] Narrow allocated single-array Pointer (#147160)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 5 13:16:02 PDT 2025
Author: Timm Baeder
Date: 2025-07-05T22:15:58+02:00
New Revision: 83401ed6a233b9c027682025fd3e2b56560dbe6e
URL: https://github.com/llvm/llvm-project/commit/83401ed6a233b9c027682025fd3e2b56560dbe6e
DIFF: https://github.com/llvm/llvm-project/commit/83401ed6a233b9c027682025fd3e2b56560dbe6e.diff
LOG: [clang][bytecode] Narrow allocated single-array Pointer (#147160)
Since the result should not be an array element.
Added:
Modified:
clang/lib/AST/ByteCode/InterpBuiltin.cpp
Removed:
################################################################################
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