You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zserio version and language
Zserio: 2.14.0
Language: C++/Java/Python
Describe the bug
The implemenation of BuiltInOperators.isSet(ZserioBitmask a, ZserioBitmask b) always assumes that all bits of b must be set in a (i.e. AND combines the two values). Zserio language specification however, allows the usage of AND, OR, and also a combination of both operators. This is why a condition like if isset(content, MyBitMask.A | MyBitMask.B) (with bitmask varuint32 MyBitMask) only evaluates to true if both bits are set.
How to reproduce
Steps to reproduce the behavior:
Example schema
bitmask varuint32 MyBitMask
{
A,
B
};
struct MyStruct
{
MyBitMask content;
string myOptionalField if isset(content, MyBitMask.A | MyBitMask.B);
};
Sample code (*.cpp / *.java / *.py)
public boolean isMyOptionalFieldUsed()
{
return (zserio.runtime.BuiltInOperators.isSet(getContent(), MyBitMask.Values.A.or(MyBitMask.Values.B)));
}
Error isMyOptionalFieldUsed() returns false when only one of the two bits (A OR B) is set in bitmask content.
Expected behavior
The implementation of the isset operator shall support OR operators and also combinations of AND and OR operators.
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Zserio version and language
Zserio: 2.14.0
Language: C++/Java/Python
Describe the bug
The implemenation of
BuiltInOperators.isSet(ZserioBitmask a, ZserioBitmask b)
always assumes that all bits ofb
must be set ina
(i.e. AND combines the two values). Zserio language specification however, allows the usage of AND, OR, and also a combination of both operators. This is why a condition likeif isset(content, MyBitMask.A | MyBitMask.B)
(withbitmask varuint32 MyBitMask
) only evaluates totrue
if both bits are set.How to reproduce
Steps to reproduce the behavior:
isMyOptionalFieldUsed()
returnsfalse
when only one of the two bits (A
ORB
) is set in bitmaskcontent
.Expected behavior
The implementation of the
isset
operator shall support OR operators and also combinations of AND and OR operators.Additional context
n/a
The text was updated successfully, but these errors were encountered: