The default bug view has changed. See this FAQ.

js/src/jsinterp.cpp:954:31: warning: comparison of unsigned expression >= 0 is always true

RESOLVED FIXED in mozilla14

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla14
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Filing bug on these build warnings:
{
js/src/jsinterp.cpp: In function ‘void LeaveWith(JSContext*)’:
js/src/jsinterp.cpp:954:31: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
js/src/jsopcode.cpp: In member function ‘char& js::Sprinter::operator[](size_t)’:
js/src/jsopcode.cpp:778:14: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
}

In both cases, we're just asserting that a value is nonnegative, and in both cases the value is unsigned so the assertion will trivially always pass.
(Assignee)

Comment 1

5 years ago
Created attachment 612601 [details] [diff] [review]
fix

In this patch's first chunk, the stackDepth method on WithObject returns uint32, as shown here:
 http://mxr.mozilla.org/mozilla-central/source/js/src/vm/ScopeObject.h#188
(the method is inherited from NestedScopeObject)
So that's unsigned.

And the second chunk directly deals with a size_t variable, which is unsigned by definition.
Attachment #612601 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #612601 - Flags: review? → review?(luke)
(Assignee)

Comment 2

5 years ago
FWIW, it looks like patch's first chunk (and the stackDepth() method that it calls) was added in Bug 713311:
 http://hg.mozilla.org/mozilla-central/rev/f0d76403ae9c#l25.176
and the second chunk (in jsopcode.cpp) was added in Bug 688891:
 http://hg.mozilla.org/mozilla-central/diff/24dac171a324/js/src/jsopcode.cpp#l1.162
Depends on: 688891, 713311

Comment 3

5 years ago
Comment on attachment 612601 [details] [diff] [review]
fix

lol.  To wit, I have the LeaveWith case nixed in a patch in my queue :)
Attachment #612601 - Flags: review?(luke) → review+
(Assignee)

Comment 4

5 years ago
(In reply to Luke Wagner [:luke] from comment #3)
> lol.  To wit, I have the LeaveWith case nixed in a patch in my queue :)

Great minds think alike! :)
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/b1db4217e068
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/b1db4217e068
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.