epics-base / pvDataCPP

pvDataCPP is an EPICS V4 C++ module
https://epics-base.github.io/pvDataCPP/
Other
6 stars 16 forks source link

PVUnion::set(UNDEFINED_INDEX, NULL) fails for discriminating union #47

Closed mdavidsaver closed 7 years ago

mdavidsaver commented 7 years ago

Due to a logic error, calling set w/ UNDEFINED_INDEX on a discriminating union tried to call getField(-1), which throws an out of range exception.

mdavidsaver commented 7 years ago

Fixed with a01885536cf093bd0f1d37a33cffaf80be1f821a

mdavidsaver commented 7 years ago

Further, select(UNDEFINED_INDEX) behaved differently for variant and discriminating unions. Was a no-op for a variant, and cleared a discriminating union. Now clears both.