As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 658516 - nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions
: nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned ...
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: :Ehsan Akhgari
: Makoto Kato [:m_kato]
Depends on:
  Show dependency treegraph
Reported: 2011-05-20 05:52 PDT by Daniel Holbert [:dholbert]
Modified: 2011-08-23 08:31 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (v1) (1.14 KB, patch)
2011-05-20 14:52 PDT, :Ehsan Akhgari
roc: review+
Details | Diff | Splinter Review

Description User image Daniel Holbert [:dholbert] 2011-05-20 05:52:49 PDT
Filing bug on this warning:
editor/libeditor/html/nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions

Flagged code is:
>   NS_ASSERTION(rangeCount == rangeItemArray.Length(), "How did that happen?");
where rangeCount is a signed int.

The contextual code already assumes it's non-negative[1], so it should be fine to just cast it to an unsigned value here.

[1] At this point in the code, we've just called  rangeItemArray.AppendElements(rangeCount), which would fail horribly if rangeCount were negative.
Comment 1 User image :Ehsan Akhgari 2011-05-20 14:52:57 PDT
Created attachment 534119 [details] [diff] [review]
Patch (v1)
Comment 2 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2011-05-21 05:13:33 PDT
Comment on attachment 534119 [details] [diff] [review]
Patch (v1)

Review of attachment 534119 [details] [diff] [review]:
Comment 3 User image Dão Gottwald [:dao] 2011-05-25 01:27:01 PDT
Comment 4 User image Trif Andrei-Alin[:AlinT] 2011-08-23 06:50:27 PDT
Is this issue fixed?
Comment 5 User image Daniel Holbert [:dholbert] 2011-08-23 08:31:16 PDT
Yes. (link to patched chunk of source: )

Note You need to log in before you can comment on or make changes to this bug.