Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,12 @@ bool Compiler<Emitter>::VisitArraySubscriptExpr(const ArraySubscriptExpr *E) {
return false;
if (DiscardResult)
return this->emitPopPtr(E);
return true;

if (E->isGLValue())
return true;

OptPrimType T = classifyPrim(E);
return this->emitLoadPop(*T, E);
}

template <class Emitter>
Expand Down
4 changes: 4 additions & 0 deletions clang/test/AST/ByteCode/c.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,7 @@ void discardedCmp(void)
{
(*_b) = ((&a == &a) , a); // all-warning {{left operand of comma operator has no effect}}
}

/// ArraySubscriptExpr that's not an lvalue
typedef unsigned char U __attribute__((vector_size(1)));
void nonLValueASE(U f) { f[0] = f[((U)(U){0})[0]]; }