Last Comment Bug 710581 - set-but-unused warning in PropertyCache::fullTest withh GCC 4.6
: set-but-unused warning in PropertyCache::fullTest withh GCC 4.6
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla11
Assigned To: Igor Bukanov
Depends on:
  Show dependency treegraph
Reported: 2011-12-14 04:10 PST by Igor Bukanov
Modified: 2011-12-16 05:58 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix (831 bytes, patch)
2011-12-14 04:12 PST, Igor Bukanov
bhackett1024: review+
Details | Diff | Splinter Review

Description Igor Bukanov 2011-12-14 04:10:17 PST
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]
Comment 1 Igor Bukanov 2011-12-14 04:12:37 PST
Created attachment 581581 [details] [diff] [review]
Comment 2 Igor Bukanov 2011-12-14 04:21:07 PST
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.

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