Issue 96055 - idlc: ambiguous && || sequence
Summary: idlc: ambiguous && || sequence
Status: CLOSED FIXED
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: chne
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-10 14:59 UTC by caolanm
Modified: 2009-03-23 12:09 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
my suspicion is that is should be like so, but maybe not, depends on the intent (900 bytes, patch)
2008-11-10 14:59 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-10 14:59:03 UTC
in idlc/source/astscope.cxx there is...

if ( (NT_service == m_nodeType) &&
     ((pDecl->getNodeType() == NT_interface_member)
      && (pDeclaration->getNodeType() == NT_interface)) ||
     ((pDecl->getNodeType() == NT_service_member)
      && (pDeclaration->getNodeType() == NT_service)))

taking the three bracketed terms this is effectively

if ( X && Y || Z)

and so binds as

if ( (X && Y) || Z )

but looking at the names of the terms it looks a little ambiguous. Might the
intent actually be...

if ( X && (Y || Z) )

i.e.

if (
     (NT_service == m_nodeType) &&
     (
       ((pDecl->getNodeType() == NT_interface_member)
        && (pDeclaration->getNodeType() == NT_interface))
       ||
       ((pDecl->getNodeType() == NT_service_member)
        && (pDeclaration->getNodeType() == NT_service))
     )
   )

or is the intent truly...

if (
     (
       (NT_service == m_nodeType) &&
       ((pDecl->getNodeType() == NT_interface_member)
        && (pDeclaration->getNodeType() == NT_interface))
     ) ||
     ((pDecl->getNodeType() == NT_service_member)
       && (pDeclaration->getNodeType() == NT_service))
   )
Comment 1 caolanm 2008-11-10 14:59:47 UTC
Created attachment 57839 [details]
my suspicion is that is should be like so, but maybe not, depends on the intent
Comment 2 kay.ramme 2008-11-11 05:03:55 UTC
Juergen, please have a look ...

Comment 3 jsc 2008-11-12 10:26:01 UTC
accepted
Comment 4 jsc 2008-11-17 12:42:53 UTC
fixed on cws jsc312
Comment 5 jsc 2008-12-04 15:42:28 UTC
jsc -> cn: please verify on cws jsc312
Comment 6 chne 2008-12-05 11:04:20 UTC
verified in cws
Comment 7 caolanm 2009-03-23 12:09:52 UTC
closing