Bug 169597 - Wrong condition in offlineasm/risc.rb
Summary: Wrong condition in offlineasm/risc.rb
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tomas Popela
URL:
Keywords:
Depends on:
Blocks: 104114
  Show dependency treegraph
 
Reported: 2017-03-14 03:53 PDT by Tomas Popela
Modified: 2017-03-14 22:52 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2017-03-14 03:55 PDT, Tomas Popela
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.