Closed Bug 710581 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(1 file)

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]
Attached patch fixSplinter Review
Assignee: general → igor
Attachment #581581 - Flags: review?(bhackett1024)
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+
https://hg.mozilla.org/mozilla-central/rev/a129c639c0f1
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.