You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Michael Gmelin (JIRA)" <xe...@xml.apache.org> on 2012/09/11 12:39:07 UTC
[jira] [Created] (XERCESC-1994) ContentSpecNode::getMaxTotalRange:
Operator precedence flaw
Michael Gmelin created XERCESC-1994:
---------------------------------------
Summary: ContentSpecNode::getMaxTotalRange: Operator precedence flaw
Key: XERCESC-1994
URL: https://issues.apache.org/jira/browse/XERCESC-1994
Project: Xerces-C++
Issue Type: Bug
Components: Validating Parser (XML Schema)
Affects Versions: 3.1.1
Environment: Not relevant, C++ syntax problem
Reporter: Michael Gmelin
Attachments: ContentSpecNode.cpp.patch
ContentSpecType.cpp says at about line 260:
if ((fType & 0x0f) == ContentSpecNode::Choice) {
max = max * (maxFirst > maxSecond) ? maxFirst : maxSecond;
}
Thanks to operator precedence max evaluates either to maxFirst or maxSecond, but never to max*maxFirst or max*maxSecond.
Adding parenthesis makes this do the right thing:
max = max * ((maxFirst > maxSecond) ? maxFirst : maxSecond);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] [Closed] (XERCESC-1994) ContentSpecNode::getMaxTotalRange:
Operator precedence flaw
Posted by "Michael Gmelin (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Gmelin closed XERCESC-1994.
-----------------------------------
Verified ok.
> ContentSpecNode::getMaxTotalRange: Operator precedence flaw
> -----------------------------------------------------------
>
> Key: XERCESC-1994
> URL: https://issues.apache.org/jira/browse/XERCESC-1994
> Project: Xerces-C++
> Issue Type: Bug
> Components: Validating Parser (XML Schema)
> Affects Versions: 3.1.1
> Environment: Not relevant, C++ syntax problem
> Reporter: Michael Gmelin
> Assignee: Alberto Massari
> Fix For: 3.2.0
>
> Attachments: ContentSpecNode.cpp.patch
>
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> ContentSpecType.cpp says at about line 260:
> if ((fType & 0x0f) == ContentSpecNode::Choice) {
> max = max * (maxFirst > maxSecond) ? maxFirst : maxSecond;
> }
> Thanks to operator precedence max evaluates either to maxFirst or maxSecond, but never to max*maxFirst or max*maxSecond.
> Adding parenthesis makes this do the right thing:
> max = max * ((maxFirst > maxSecond) ? maxFirst : maxSecond);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] [Updated] (XERCESC-1994) ContentSpecNode::getMaxTotalRange:
Operator precedence flaw
Posted by "Michael Gmelin (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Gmelin updated XERCESC-1994:
------------------------------------
Attachment: ContentSpecNode.cpp.patch
Fix for operator precedence flaw
> ContentSpecNode::getMaxTotalRange: Operator precedence flaw
> -----------------------------------------------------------
>
> Key: XERCESC-1994
> URL: https://issues.apache.org/jira/browse/XERCESC-1994
> Project: Xerces-C++
> Issue Type: Bug
> Components: Validating Parser (XML Schema)
> Affects Versions: 3.1.1
> Environment: Not relevant, C++ syntax problem
> Reporter: Michael Gmelin
> Attachments: ContentSpecNode.cpp.patch
>
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> ContentSpecType.cpp says at about line 260:
> if ((fType & 0x0f) == ContentSpecNode::Choice) {
> max = max * (maxFirst > maxSecond) ? maxFirst : maxSecond;
> }
> Thanks to operator precedence max evaluates either to maxFirst or maxSecond, but never to max*maxFirst or max*maxSecond.
> Adding parenthesis makes this do the right thing:
> max = max * ((maxFirst > maxSecond) ? maxFirst : maxSecond);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] [Resolved] (XERCESC-1994) ContentSpecNode::getMaxTotalRange:
Operator precedence flaw
Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alberto Massari resolved XERCESC-1994.
--------------------------------------
Resolution: Fixed
Fix Version/s: 3.2.0
Assignee: Alberto Massari
A fix is in SVN. Please verify.
> ContentSpecNode::getMaxTotalRange: Operator precedence flaw
> -----------------------------------------------------------
>
> Key: XERCESC-1994
> URL: https://issues.apache.org/jira/browse/XERCESC-1994
> Project: Xerces-C++
> Issue Type: Bug
> Components: Validating Parser (XML Schema)
> Affects Versions: 3.1.1
> Environment: Not relevant, C++ syntax problem
> Reporter: Michael Gmelin
> Assignee: Alberto Massari
> Fix For: 3.2.0
>
> Attachments: ContentSpecNode.cpp.patch
>
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> ContentSpecType.cpp says at about line 260:
> if ((fType & 0x0f) == ContentSpecNode::Choice) {
> max = max * (maxFirst > maxSecond) ? maxFirst : maxSecond;
> }
> Thanks to operator precedence max evaluates either to maxFirst or maxSecond, but never to max*maxFirst or max*maxSecond.
> Adding parenthesis makes this do the right thing:
> max = max * ((maxFirst > maxSecond) ? maxFirst : maxSecond);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org