Closed Bug 515242 Opened 11 years ago Closed 11 years ago

IPDL: python error without parsing error

Categories

(Core :: IPC, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: cjones)

References

Details

Attachments

(1 file)

I'm creating a new protocol and encountering a python error compiling some IPDL file:

Parsing specification ../../../src/dom/plugins/NPAPI.ipdl
yacc: Warning. Token 'SHARE' defined, but not used.
yacc: Warning. Token 'TRANSFER' defined, but not used.
yacc: Warning. There are 2 unused tokens.
yacc: Warning. Token 'SHARE' defined, but not used.
yacc: Warning. Token 'TRANSFER' defined, but not used.
yacc: Warning. There are 2 unused tokens.
yacc: Warning. Token 'SHARE' defined, but not used.
yacc: Warning. Token 'TRANSFER' defined, but not used.
yacc: Warning. There are 2 unused tokens.
yacc: Warning. Token 'SHARE' defined, but not used.
yacc: Warning. Token 'TRANSFER' defined, but not used.
yacc: Warning. There are 2 unused tokens.
yacc: Warning. Token 'SHARE' defined, but not used.
yacc: Warning. Token 'TRANSFER' defined, but not used.
yacc: Warning. There are 2 unused tokens.
Traceback (most recent call last):
  File "../../../src/config/pythonpath.py", line 40, in <module>
    execfile(script, {'__name__': '__main__', '__file__': script})
  File "../../../src/ipc/ipdl/ipdl.py", line 87, in <module>
    if not ipdl.typecheck(ast):
  File "../../../src/ipc/ipdl/ipdl/__init__.py", line 53, in typecheck
    return TypeCheck().check(ast, errout)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 316, in check
    if not runpass(GatherDecls(builtinUsing, self.errors)):
  File "../../../src/ipc/ipdl/ipdl/type.py", line 306, in runpass
    tu.accept(tcheckpass)
  File "../../../src/ipc/ipdl/ipdl/ast.py", line 130, in accept
    return visit(self)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 412, in visitTranslationUnit
    pinc.accept(self)
  File "../../../src/ipc/ipdl/ipdl/ast.py", line 130, in accept
    return visit(self)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 427, in visitProtocolInclude
    pi.tu.accept(self)
  File "../../../src/ipc/ipdl/ipdl/ast.py", line 130, in accept
    return visit(self)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 419, in visitTranslationUnit
    p.accept(self)
  File "../../../src/ipc/ipdl/ipdl/ast.py", line 130, in accept
    return visit(self)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 518, in visitProtocol
    resolvestate(iparam)
  File "../../../src/ipc/ipdl/ipdl/type.py", line 498, in resolvestate
    statename = param.type.state.name
AttributeError: 'NoneType' object has no attribute 'name'

Attached is the patch against Electrolysis which causes this error.
The problem is that IPDL allows passing actor types as params/returns for messages, but the feature was incompletely implemented.  Actor types can be specified to be in a particular state, |Foo:STATE1|, or not, |Foo|.  The parser supports both but the type checker does not support the latter.  This should be relatively easy to fix.
Pushed http://hg.mozilla.org/projects/electrolysis/rev/33ec43a38826

Note that your patch has a separate user bug, but the error message is actually good for once.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.