Bug 169597

Summary: Wrong condition in offlineasm/risc.rb
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: JavaScriptCoreAssignee: Tomas Popela <tpopela>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, msaboff, sbarati
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 104114    
Attachments:
Description Flags
Patch none

Description Tomas Popela 2017-03-14 03:53:36 PDT
Found by Coverity scan:

webkitgtk-2.14.5/Source/JavaScriptCore/offlineasm/risc.rb:378: unused_expr: Discarding the result of operator "==" in "node.operands().size() == 2". What was this code intended to accomplish?
webkitgtk-2.14.5/Source/JavaScriptCore/offlineasm/risc.rb:378: remediation: Did you intend to make an assertion or assignment?
#  376|                           (not validImmediates.include? node.operands[0].value) and
#  377|                           validImmediates.include? -node.operands[0].value
#  378|->                         node.operands.size == 2
#  379|                       if node.opcode =~ /add/
#  380|                           newOpcode = "sub" + $~.post_match
Comment 1 Tomas Popela 2017-03-14 03:55:24 PDT
Created attachment 304371 [details]
Patch
Comment 2 Mark Lam 2017-03-14 10:39:53 PDT
Comment on attachment 304371 [details]
Patch

r=me
Comment 3 Tomas Popela 2017-03-14 22:52:16 PDT
Comment on attachment 304371 [details]
Patch

Clearing flags on attachment: 304371

Committed r213973: <http://trac.webkit.org/changeset/213973>
Comment 4 Tomas Popela 2017-03-14 22:52:25 PDT
All reviewed patches have been landed.  Closing bug.