Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clang/lib/AST/ByteCode/Interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2126,10 +2126,10 @@ bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
const T &Value = S.Stk.pop<T>();
const Pointer &Ptr = S.Stk.peek<Pointer>();

if (Ptr.isUnknownSizeArray())
const Descriptor *Desc = Ptr.getFieldDesc();
if (Desc->isUnknownSizeArray())
return false;

const Descriptor *Desc = Ptr.getFieldDesc();
// In the unlikely event that we're initializing the first item of
// a non-array, skip the atIndex().
if (Idx == 0 && !Desc->isArray()) {
Expand Down Expand Up @@ -2160,10 +2160,10 @@ bool InitElemPop(InterpState &S, CodePtr OpPC, uint32_t Idx) {
const T &Value = S.Stk.pop<T>();
const Pointer &Ptr = S.Stk.pop<Pointer>();

if (Ptr.isUnknownSizeArray())
const Descriptor *Desc = Ptr.getFieldDesc();
if (Desc->isUnknownSizeArray())
return false;

const Descriptor *Desc = Ptr.getFieldDesc();
// In the unlikely event that we're initializing the first item of
// a non-array, skip the atIndex().
if (Idx == 0 && !Desc->isArray()) {
Expand Down