Closed Bug 1275064 Opened 4 years ago Closed 4 years ago

Use unsigned int in |RealWord| bitfield

Categories

(Core :: Spelling checker, defect, critical)

45 Branch
x86
Windows NT
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: erahm, Assigned: erahm)

References

Details

Attachments

(1 file, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #1261304 +++

Per bug 1261304, comment 13 we should use an unsigned type when using a bitfield in the |RealWord| struct.
Attachment #8755547 - Flags: review?(nfroyd)
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Comment on attachment 8755547 [details] [diff] [review]
Use unsigned type in RealWord bitfield

Review of attachment 8755547 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the change below.

::: extensions/spellcheck/src/mozInlineSpellWordUtil.h
@@ +130,2 @@
>      
> +    RealWord(int32_t aOffset, uint32_t aLength, bool aCheckable)

Can you MOZ_ASSERT that aLength < INT32_MAX?  That will ensure that it fits in the bitfield and that the code isn't trying to do something funny with negative values.
Attachment #8755547 - Flags: review?(nfroyd) → review+
Attachment #8755547 - Attachment is obsolete: true
Attachment #8755608 - Flags: review+
Keywords: checkin-needed
Werror strikes again:

> 02:44:29     INFO -  c:/builds/moz2_slave/m-in-w32-000000000000000000000/build/src/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp(786): error C2220: warning treated as error - no 'object' file generated
> 02:44:29     INFO -  Warning: C4018 in c:\builds\moz2_slave\m-in-w32-000000000000000000000\build\src\extensions\spellcheck\src\mozInlineSpellWordUtil.cpp: '<=': signed/unsigned mismatch
> 02:44:29 INFO - c:/builds/moz2_slave/m-in-w32-000000000000000000000/build/src/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp(786): warning C4018: '<=': signed/unsigned mismatch
Flags: needinfo?(erahm)
Attachment #8755608 - Attachment is obsolete: true
Comment on attachment 8756488 [details] [diff] [review]
Use unsigned type in RealWord bitfield

Carrying forward r+
Attachment #8756488 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0928a16792af
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.