[BinAST] handle break/continue without loop properly

RESOLVED FIXED in Firefox 67

Status

()

enhancement
P3
normal
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: arai, Assigned: arai)

Tracking

(Blocks 1 bug)

Trunk
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(5 attachments)

Comment hidden (empty)
(Assignee)

Comment 3

3 months ago

Integrated binjs_convert_from_json into encode.py.
encode.py now generates invalid BinAST file if --binjs_convert_from_json option
is provided.

Source of test files are located inside js/src/jsapi-tests/binast/invalid/tests,
with .js file as a source of JSON, and .py file for filtering the JSON.

The generated tests are located inside js/src/jit-test/tests/binast/invalid.

filter_utils.py provides some utility functions that is used by filter script,
to handle tagged tuple/list structure in the JSON encoded AST.

Actual testcases are added in Part 3.

Depends on D18559

(Assignee)

Comment 5

3 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/614dba865475b0d1266b12c8ba2ef6600c877508
Bug 1524965 - Part 0: Fix error message formatting in BinAST. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/69c5e07b7aaed0f5b6230ab37ece564f4cd6f715
Bug 1524965 - Part 1: Handle break/continue outside the loop properly. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/45203e397c4a9342c90ab3f0d542119d122f3415
Bug 1524965 - Part 2: Add a script to generate testcases for BinAST with invalid content. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/4470bbd6ad9d3bc9b76dbea96c11762ff882b890
Bug 1524965 - Part 3: Add testcase for break/continue outside the loop. r=Yoric
(Assignee)

Comment 7

3 months ago

switchStatement handling was missing the allocation of ParseContext::Statement.
added it and now checkBreakStatement can find it.

Flags: needinfo?(arai.unmht)
Attachment #9041864 - Flags: review?(dteller)
Comment on attachment 9041864 [details] [diff] [review]
Part 0.2: Allocate StatementKind::Switch context in BinAST. r?Yoric

Review of attachment 9041864 [details] [diff] [review]:
-----------------------------------------------------------------

Good catch!
I wonder why we hadn't noticed the issue previously.
Attachment #9041864 - Flags: review?(dteller) → review+
(Assignee)

Comment 9

3 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/9849e6b02bc2d32da3403130f1235b7c8296c651
Bug 1524965 - Part 0: Fix error message formatting in BinAST. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/7fce2598a3de8f3372ae4d7baba5f05b3ed36e5a
Bug 1524965 - Part 1: Allocate StatementKind::Switch context in BinAST. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/30e403f80bfd23dae0b7e416f7772fe72157e01f
Bug 1524965 - Part 2: Handle break/continue outside the loop properly. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/1143fee910c70ae6ea25e325b7908f38c8cfeba6
Bug 1524965 - Part 3: Add a script to generate testcases for BinAST with invalid content. r=Yoric

https://hg.mozilla.org/integration/mozilla-inbound/rev/21aedfe62db37db8ee18416c62863b4df28c8327
Bug 1524965 - Part 4: Add testcase for break/continue outside the loop. r=Yoric
You need to log in before you can comment on or make changes to this bug.