Don't assert on m_actionsStart when setting actions on DFA nodes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 18:10:50 +0000 (18:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 18:10:50 +0000 (18:10 +0000)
commitee387cc0458cae76a8081b76daae0eb5662f4238
tree27879524d1bc8b5af294efa1d35a347638432ed3
parent39d5540a0b834905ab0685883e5c8e1f0e2b52f9
Don't assert on m_actionsStart when setting actions on DFA nodes
https://bugs.webkit.org/show_bug.cgi?id=185979
<rdar://problem/39669458>

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-05-29
Reviewed by Geoffrey Garen.

DFANode::setActions is called immediately after the node is created, and once again to set
the actions of catch-all regular expressions (.*) on the root node. That works because
m_actionsStart is initially 0, since the root was the first node to be created, but may fail
after minimizing the DFA, when the root may no longer be the first node, and therefore
m_actionsStart would not be 0, even if there are no actions attached to that node.

Source/WebCore:

Test: http/tests/contentextensions/root-actions.html

* contentextensions/DFANode.h:

LayoutTests:

* http/tests/contentextensions/root-actions-expected.txt: Added.
* http/tests/contentextensions/root-actions.html: Added.
* http/tests/contentextensions/root-actions.html.json: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/contentextensions/root-actions-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/contentextensions/root-actions.html [new file with mode: 0644]
LayoutTests/http/tests/contentextensions/root-actions.html.json [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/contentextensions/DFANode.h