set-but-unused warning in PropertyCache::fullTest withh GCC 4.6

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Igor Bukanov, Assigned: Igor Bukanov)

Tracking

unspecified
mozilla11
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
For optimized builds GCC 4.6 reports :

.../js/src/jspropertycache.cpp: In member function ‘JSAtom* js::PropertyCache::fullTest(JSContext*, jsbytecode*, JSObject**, JSObject**, js::PropertyCacheEntry*)’:
/home/igor/m/mc/js/src/jspropertycache.cpp:188:15: warning: unused variable ‘script’ [-Wunused-variable]
(Assignee)

Comment 1

6 years ago
Created attachment 581581 [details] [diff] [review]
fix
Assignee: general → igor
Attachment #581581 - Flags: review?(bhackett1024)
(Assignee)

Comment 2

6 years ago
The patch uses explicit #ifdef DEBUG and not DebugOnly<JScript *> script = cx->stack.currentScript(). The right-hand side here is rather complex inline function and contains calls to functions defined in other files. So a compiler most likely will not see that the function does not affect the global state and preserve the call.
Attachment #581581 - Flags: review?(bhackett1024) → review+
(Assignee)

Comment 3

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