Bug 27625 - cpplint crash when there is a duplicate header followed by another header.
Summary: cpplint crash when there is a duplicate header followed by another header.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-23 14:09 PDT by Kenneth Rohde Christiansen
Modified: 2009-07-24 09:30 PDT (History)
2 users (show)

See Also:


Attachments
Proposed fix. (10.56 KB, patch)
2009-07-24 03:12 PDT, David Levin
manyoso: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Rohde Christiansen 2009-07-23 14:09:11 PDT
python WebKitTools/Scripts/modules/cpplint.py WebKit/qt/WebCoreSupport/*cpp in current tot 46283, crashes:


Backtrace:

...
Done processing WebKit/qt/WebCoreSupport/EditCommandQt.cpp
WebKit/qt/WebCoreSupport/EditorClientQt.cpp:37:  Alphabetical sorting problem.  [build/include_order] [4]
WebKit/qt/WebCoreSupport/EditorClientQt.cpp:48:  "Page.h" already included at WebKit/qt/WebCoreSupport/EditorClientQt.cpp:47  [build/include] [4]
Traceback (most recent call last):
  File "WebKitTools/Scripts/modules/cpplint.py", line 3024, in <module>
    main()
  File "WebKitTools/Scripts/modules/cpplint.py", line 3018, in main
    process_file(filename)
  File "WebKitTools/Scripts/modules/cpplint.py", line 2878, in process_file
    process_file_data(filename, file_extension, lines, error)
  File "WebKitTools/Scripts/modules/cpplint.py", line 2819, in process_file_data
    include_state, function_state, class_state, error)
  File "WebKitTools/Scripts/modules/cpplint.py", line 2786, in process_line
    error)
  File "WebKitTools/Scripts/modules/cpplint.py", line 2285, in check_language
    check_include_line(filename, clean_lines, line_number, include_state, error)
  File "WebKitTools/Scripts/modules/cpplint.py", line 2234, in check_include_line
    previous_header_type = include_state.header_types[previous_line_number]
KeyError: 48
Comment 1 David Levin 2009-07-24 03:12:23 PDT
Created attachment 33421 [details]
Proposed fix.
Comment 2 Kenneth Rohde Christiansen 2009-07-24 05:14:14 PDT
Oh, you beat me to it :-)

The patch looks fine, and I find the code clearer now.
Comment 3 David Levin 2009-07-24 09:30:51 PDT
Committed as http://trac.webkit.org/changeset/46357