Bug 90740

Summary: children method in LLINT AST Not class should return [@child]
Product: WebKit Reporter: lds <laurent>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, fpizlo, galpeter, laurent, mark.lam, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 111568    
Attachments:
Description Flags
Fix for the children method none

Description lds 2012-07-08 15:37:53 PDT
While experimenting with the new llint in JSCore,  I noticed that the
Not class (located in offlineasm/ast.rb) may have an incorrect method:

class Not < Node
    attr_reader :child

    def initialize(codeOrigin, child)
        super(codeOrigin)
        @child = child
    end

    def children
        [@left, @right]
    end

    def mapChildren
        Not.new(codeOrigin, (yield @child))
    end

    def dump
        "(not #{child.dump})"
    end
end



Shouldn't children of this 'Not' class be

    def children
        [@child]
    end

instead, since it's  a unary operator?
Comment 1 Peter Gal 2013-03-06 05:43:57 PST
Created attachment 191731 [details]
Fix for the children method

I think this is also a problem. So this patch should fix it.
Comment 2 Build Bot 2013-03-07 00:09:51 PST
Comment on attachment 191731 [details]
Fix for the children method

Attachment 191731 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17067209

New failing tests:
editing/selection/selection-modify-crash.html
Comment 3 Peter Gal 2013-03-07 00:18:55 PST
(In reply to comment #2)
> (From update of attachment 191731 [details])
> Attachment 191731 [details] did not pass mac-ews (mac):
> Output: http://webkit-commit-queue.appspot.com/results/17067209
> 
> New failing tests:
> editing/selection/selection-modify-crash.html

This patch can not cause this fail, because at this time the 'Not' node is not used at all.
Comment 4 Filip Pizlo 2013-03-07 00:19:13 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 191731 [details] [details])
> > Attachment 191731 [details] [details] did not pass mac-ews (mac):
> > Output: http://webkit-commit-queue.appspot.com/results/17067209
> > 
> > New failing tests:
> > editing/selection/selection-modify-crash.html
> 
> This patch can not cause this fail, because at this time the 'Not' node is not used at all.

Agreed.
Comment 5 WebKit Review Bot 2013-03-07 00:20:51 PST
Comment on attachment 191731 [details]
Fix for the children method

Clearing flags on attachment: 191731

Committed r145047: <http://trac.webkit.org/changeset/145047>
Comment 6 WebKit Review Bot 2013-03-07 00:20:55 PST
All reviewed patches have been landed.  Closing bug.