Closed
Bug 1276567
Opened 9 years ago
Closed 9 years ago
Fix -Wstring-conversion warnings in js/ directory
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla49
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file, 1 obsolete file)
|
3.93 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
clang's -Wstring-conversion warning warns about the use of string literals as boolean expressions. This is not uncommon in "always fail" assertions, but MOZ_ASSERT_UNREACHABLE() or MOZ_CRASH() are better solutions.
Is it safe to assert (or even MOZ_CRASH) in the "<dead CPOW>" case of WrapperAnswer::RecvClassName()?
js/ipc/WrapperAnswer.cpp:531:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [12]' to 'bool'
js/src/jit/MIR.h:63:25 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [26]' to 'bool'
js/src/jit/SharedIC.cpp:1648:21 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [30]' to 'bool'
js/src/jsgc.cpp:7135:21 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [59]' to 'bool'
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8757770 -
Flags: review?(wmccloskey)
Comment on attachment 8757770 [details] [diff] [review]
Fix -Wstring-conversion warnings in js/ directory
Review of attachment 8757770 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/ipc/WrapperAnswer.cpp
@@ +550,5 @@
> RootedObject obj(cx, findObjectById(cx, objId));
> if (!obj) {
> // This is very unfortunate, but we have no choice.
> + MOZ_ASSERT_UNREACHABLE("<dead CPOW>");
> + return false;
This should assign "<dead CPOW>" to *name and return true.
Attachment #8757770 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 3•9 years ago
|
||
Patch v2 assigns "<dead CPOW>" to *name and returns true.
Attachment #8757770 -
Attachment is obsolete: true
Attachment #8758359 -
Flags: review?(wmccloskey)
Attachment #8758359 -
Flags: review?(wmccloskey) → review+
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d71c62d3caa
Fix -Wstring-conversion warnings in js/ directory. r=billm
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 5•9 years ago
|
||
| bugherder | ||
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•