Bug 63814 - Fix clang build error in JITOpcodes32_64.cpp
Summary: Fix clang build error in JITOpcodes32_64.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-07-01 09:16 PDT by David Kilzer (:ddkilzer)
Modified: 2011-07-01 13:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.90 KB, patch)
2011-07-01 09:21 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2011-07-01 09:16:42 PDT
JavaScriptCore/jit/JITOpcodes32_64.cpp:741:36:{741:9-741:35}: error: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Werror,-Wparentheses,3]
     map(m_bytecodeOffset + dynamic ? OPCODE_LENGTH(op_resolve_global_dynamic) : OPCODE_LENGTH(op_resolve_global), dst, regT1, regT0);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
JavaScriptCore/jit/JITOpcodes32_64.cpp:741:36: note: place parentheses around the '+' expression to silence this warning [3] 
     map(m_bytecodeOffset + dynamic ? OPCODE_LENGTH(op_resolve_global_dynamic) : OPCODE_LENGTH(op_resolve_global), dst, regT1, regT0);
                                    ^           
         (                         )           
fix-it:"JavaScriptCore/jit/JITOpcodes32_64.cpp":{741:9-741:9}:"("
fix-it:"JavaScriptCore/jit/JITOpcodes32_64.cpp":{741:35-741:35}:")"
JavaScriptCore/jit/JITOpcodes32_64.cpp:741:36:{741:28-741:94}: note: place parentheses around the '?:' expression to evaluate it first [3]
     map(m_bytecodeOffset + dynamic ? OPCODE_LENGTH(op_resolve_global_dynamic) : OPCODE_LENGTH(op_resolve_global), dst, regT1, regT0);
                            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Comment 1 David Kilzer (:ddkilzer) 2011-07-01 09:20:37 PDT
Committed r90232: <http://trac.webkit.org/changeset/90232>
Comment 2 David Kilzer (:ddkilzer) 2011-07-01 09:21:26 PDT
Created attachment 99482 [details]
Patch
Comment 3 Darin Adler 2011-07-01 09:26:33 PDT
Looks to me like clang correctly spotted a programming error here, so there was a symptom of this too.
Comment 4 David Kilzer (:ddkilzer) 2011-07-01 09:45:50 PDT
This code was originally introduced in r58991 in JavaScriptCore/jit/JITOpcodes.cpp.

<http://trac.webkit.org/changeset/58991>
Comment 5 Alexey Proskuryakov 2011-07-01 10:32:37 PDT
How could this be landed without review, and without a regression test?
Comment 6 Alexey Proskuryakov 2011-07-01 10:33:32 PDT
I have an answer to my question - probably because it was originally believed that it's only a build fix.
Comment 7 David Kilzer (:ddkilzer) 2011-07-01 13:48:00 PDT
<rdar://problem/9713309>