[PATCH] D154189: [clang][Interp] Implement zero-init of record types
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 30 01:40:53 PDT 2023
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1115
+ // all field and bases explicitly.
+ if (E->requiresZeroInitialization() && Ctor->isTrivial()) {
+ assert(E->getType()->isRecordType());
----------------
I briefly talked about this with @aaron.ballman on IRC. The current interpreter properly zero-initialized all the fields of a struct, but the un-does the initialization again (and initializes them to a `APValue::Indeterminate` in `HandleConstructorCall::SkipToField()`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154189/new/
https://reviews.llvm.org/D154189
More information about the cfe-commits
mailing list