Kaydet (Commit) 1c27bb52 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some trivial -fsanitize=undefined adaptions

Change-Id: I60f6e2b5f041919319cb6b72684b8b7b8504560c
üst 4586d79d
......@@ -63,7 +63,7 @@ public:
sal_Int32 GetLong() const
{
return aExp.aLong.nLo |
((sal_Int32)aExp.aLong.nHi << 16);
((sal_uInt32)aExp.aLong.nHi << 16);
}
bool Evaluate( sal_Int32 * pValue ) const;
void AppendMacro( OStringBuffer & ) const;
......
......@@ -291,16 +291,15 @@ again: ;
}
opp->op = (char)op;
opp->prec = (char)prec;
skip = (valp[-1] != 0); /* Short-circuit tester */
/*
* Do the short-circuit stuff here. Short-circuiting
* stops automagically when operators are evaluated.
*/
if ((op == OP_ANA && !skip)
|| (op == OP_ORO && skip))
if ((op == OP_ANA && valp[-1] == 0)
|| (op == OP_ORO && valp[-1] != 0))
opp->skip = S_ANDOR; /* And/or skip starts */
else if (op == OP_QUE) /* Start of ?: operator */
opp->skip = (char)((op1 & S_ANDOR) | ((!skip) ? S_QUEST : 0));
opp->skip = (char)((op1 & S_ANDOR) | ((valp[-1] == 0) ? S_QUEST : 0));
else if (op == OP_COL) { /* : inverts S_QUEST */
opp->skip = (char)((op1 & S_ANDOR)
| (((op1 & S_QUEST) != 0) ? 0 : S_QUEST));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment