Skip to content

Commit

Permalink
open62541: fix writing to enum structure fields
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-zimoch committed Oct 29, 2024
1 parent b4d2cdb commit 3bf4592
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion devOpcuaSup/open62541/DataElementOpen62541.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ DataElementOpen62541::updateDataInStruct(void* container,
char* memberData = static_cast<char*>(container) + pelem->offset;
const UA_Variant& elementData = pelem->getOutgoingData();
const UA_DataType* memberType = pelem->memberType;
assert(memberType == elementData.type);
assert(memberType == elementData.type ||
(typeKindOf(memberType) == UA_DATATYPEKIND_ENUM && typeKindOf(elementData.type) == UA_DATATYPEKIND_INT32));
if (!pelem->isArray && !pelem->isOptional) {
// mandatory scalar: shallow copy
UA_clear(memberData, memberType);
Expand Down

0 comments on commit 3bf4592

Please sign in to comment.