Skip to content

Commit 498757e

Browse files
committed
[clang][Interp][NFC] Fix initializing union APValues
The InitElem op assumes an array.
1 parent 34a2889 commit 498757e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3507,7 +3507,7 @@ bool ByteCodeExprGen<Emitter>::visitAPValueInitializer(const APValue &Val,
35073507
PrimType T = classifyPrim(RF->Decl->getType());
35083508
if (!this->visitAPValue(F, T, E))
35093509
return false;
3510-
return this->emitInitElem(T, 0, E);
3510+
return this->emitInitField(T, RF->Offset, E);
35113511
}
35123512
// TODO: Other types.
35133513

0 commit comments

Comments
 (0)