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
Connected to pydev debugger (build 192.6262.63)
Traceback (most recent call last):
File "/home/fuzz/.virtualenvs/pypy_xfuzz/site-packages/CppHeaderParser/CppHeaderParser.py", line 2913, in __init__
self._evaluate_stack()
File "/home/fuzz/.virtualenvs/pypy_xfuzz/site-packages/CppHeaderParser/CppHeaderParser.py", line 3343, in _evaluate_stack
self._parse_enum()
File "/home/fuzz/.virtualenvs/pypy_xfuzz/site-packages/CppHeaderParser/CppHeaderParser.py", line 3536, in _parse_enum
self._next_token_must_be(";")
File "/home/fuzz/.virtualenvs/pypy_xfuzz/site-packages/CppHeaderParser/CppHeaderParser.py", line 3113, in _next_token_must_be
raise self._parse_error((tok,), "' or '".join(tokenTypes))
CppHeaderParser.CppHeaderParser.CppParseError: unexpected ',', expected ';'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/fuzz/app/pycharm-2019.2.1/helpers/pydev/pydevd.py", line 2060, in <module>
main()
File "/home/fuzz/app/pycharm-2019.2.1/helpers/pydev/pydevd.py", line 2054, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/fuzz/app/pycharm-2019.2.1/helpers/pydev/pydevd.py", line 1405, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/home/fuzz/app/pycharm-2019.2.1/helpers/pydev/pydevd.py", line 1412, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/fuzz/app/pycharm-2019.2.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/fuzz/workspace/xfuzz/database/src_code_analysis/analysis.py", line 3, in <module>
header = CppHeaderParser.CppHeader('/home/fuzz/workspace/xfuzz/database/windos_sdk_hfs/Include/WinSock2.h')
File "/home/fuzz/.virtualenvs/pypy_xfuzz/site-packages/CppHeaderParser/CppHeaderParser.py", line 3048, in __init__
CppParseError(msg), e,
File "<string>", line 1, in raise_exc
CppHeaderParser.CppHeaderParser.CppParseError: Not able to parse /home/fuzz/workspace/xfuzz/database/windos_sdk_hfs/Include/WinSock2.h on line 1074 evaluating ',': unexpected ',', expected ';'
Error around: typedef enum _WSACOMPLETIONTYPE
The text was updated successfully, but these errors were encountered:
Definitely a bug. I don't really have an interest in fixing this myself (lots of stuff going on), but I can provide guidance for debugging/fixing this if you would like to fix it and make a PR.
In particular, I find that setting the environment variable CPPHEADERPARSER_DEBUG=1 is really useful for figuring out what the parser is doing.
I imagine that this isn't the only piece in the SDK that would cause problems. Might try just commenting out that enum and see what else breaks.
The following code has the same parsing error: evaluating '': unexpected '', expected ';'
struct AudioPortCapability {
enum AudioFormat* formats; /**< Supported audio formats. For details, see {@link AudioFormat}. */
};
After I modified the following code, the program can run normally:
def _parse_enum(self):
......
# TODO: nested_name_specifier
name = ""
if nametok.type == "NAME":
name = nametok.value
debug_print("enum name is '%s'", name)
tok = self.lex.token()
#MODIFED:
if tok.value == "*":
name = name + ' *'
tok = self.lex.token()
else:
debug_print("anonymous enum")
tok = nametok
@liuyongbao1982 That looks like a different parse error to me. If you open a PR though with your change and a test, we'd be happy to take your change, since that's also a bug.
This is detailed exception information:
The text was updated successfully, but these errors were encountered: