mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
4760e9f4b7
Specifically, it seems that G++ 4.8.1 is unable to tell that the call to AutoCompartment::~AutoCompartment is protected by the Maybe::constructed flag. The "solution" is not to use Maybe here; although Debugger.cpp uses Maybe<AutoCompartment> everywhere, it gets away with it because it always actually constructs the Maybe(?!?). It's a shame to let the compiler's stupidity shape the code, but that particular warning is valuable elsewhere, so I feel that we shouldn't just disable the warning. In file included from /home/jimb/moz/dbg/js/src/jsobjinlines.h:20:0, from /home/jimb/moz/dbg/js/src/vm/StructuredClone.cpp:44: /home/jimb/moz/dbg/js/src/jscompartmentinlines.h: In function ‘bool JS_StructuredClone(JSContext*, JS::Value, JS::Value*, const JSStructuredCloneCallbacks*, void*)’: /home/jimb/moz/dbg/js/src/jscompartmentinlines.h:45:35: warning: ‘ac.js::AutoCompartment::origin_’ may be used uninitialized in this function [-Wmaybe-uninitialized] cx_->leaveCompartment(origin_); ^ /home/jimb/moz/dbg/js/src/vm/StructuredClone.cpp:1521:41: note: ‘ac.js::AutoCompartment::origin_’ was declared here mozilla::Maybe<AutoCompartment> ac; ^ In file included from /home/jimb/moz/dbg/js/src/jsobjinlines.h:20:0, from /home/jimb/moz/dbg/js/src/vm/StructuredClone.cpp:44: /home/jimb/moz/dbg/js/src/jscompartmentinlines.h:45:35: warning: ‘ac.js::AutoCompartment::cx_’ may be used uninitialized in this function [-Wmaybe-uninitialized] cx_->leaveCompartment(origin_); ^ /home/jimb/moz/dbg/js/src/vm/StructuredClone.cpp:1521:41: note: ‘ac.js::AutoCompartment::cx_’ was declared here mozilla::Maybe<AutoCompartment> ac; ^ |
||
---|---|---|
.. | ||
ductwork/debugger | ||
examples | ||
ipc | ||
jsd | ||
public | ||
src | ||
xpconnect |