Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(114)

Issue 202360043: Fix optimization of function calls to not leak this. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 2 months ago by Mike Samuel
Modified:
9 years, 2 months ago
CC:
google-caja-discuss_googlegroups.com, MarkM
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The optimizer was propagating an isFn bit improperly when folding expressions which caused (0, a.b)() to simplify to (a.b()) which leaks (a.b) as the "this" value for the call. There was another problem in folding which caused an infinite loop on the test cases added to JsOptimizerTest. That was fixed in Operation.fold. Submitted at r5713

Patch Set 1 #

Patch Set 2 : Fix optimization of function calls to not leak this. #

Patch Set 3 : Fix optimization of function calls to not leak this. #

Patch Set 4 : Fix optimization of function calls to not leak this. #

Total comments: 2

Patch Set 5 : Fix optimization of function calls to not leak this. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -7 lines) Patch
M src/com/google/caja/ancillary/opt/StatementSimplifier.java View 1 2 3 chunks +41 lines, -5 lines 0 comments Download
M src/com/google/caja/parser/js/Operation.java View 1 2 3 2 chunks +11 lines, -2 lines 0 comments Download
M tests/com/google/caja/ancillary/opt/JsOptimizerTest.java View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 10
Mike Samuel
9 years, 2 months ago (2015-02-26 18:02:48 UTC) #1
MarkM
codereview.appspot is not showing me any differences.
9 years, 2 months ago (2015-02-26 18:07:54 UTC) #2
Mike Samuel
The optimizer was propagating an isFn bit improperly when folding expressions which caused (0, a.b)() ...
9 years, 2 months ago (2015-02-26 18:08:08 UTC) #3
Mike Samuel
The optimizer was propagating an isFn bit improperly when folding expressions which caused (0, a.b)() ...
9 years, 2 months ago (2015-02-26 18:10:27 UTC) #4
Mike Samuel
The optimizer was propagating an isFn bit improperly when folding expressions which caused (0, a.b)() ...
9 years, 2 months ago (2015-02-26 18:12:16 UTC) #5
Mike Samuel
Yeah. I had diff-cmd=colordiff in my .subversion/config and our myvn script doesn't know to ignore ...
9 years, 2 months ago (2015-02-26 18:32:36 UTC) #6
kpreid_google
LGTM https://codereview.appspot.com/202360043/diff/2/tests/com/google/caja/ancillary/opt/JsOptimizerTest.java File tests/com/google/caja/ancillary/opt/JsOptimizerTest.java (right): https://codereview.appspot.com/202360043/diff/2/tests/com/google/caja/ancillary/opt/JsOptimizerTest.java#newcode87 tests/com/google/caja/ancillary/opt/JsOptimizerTest.java:87: public final void testThisNotUnintentionallyPassed1() throws Exception { This ...
9 years, 2 months ago (2015-02-26 18:32:38 UTC) #7
Mike Samuel
The optimizer was propagating an isFn bit improperly when folding expressions which caused (0, a.b)() ...
9 years, 2 months ago (2015-02-26 20:28:47 UTC) #8
Mike Samuel
https://codereview.appspot.com/202360043/diff/2/tests/com/google/caja/ancillary/opt/JsOptimizerTest.java File tests/com/google/caja/ancillary/opt/JsOptimizerTest.java (right): https://codereview.appspot.com/202360043/diff/2/tests/com/google/caja/ancillary/opt/JsOptimizerTest.java#newcode87 tests/com/google/caja/ancillary/opt/JsOptimizerTest.java:87: public final void testThisNotUnintentionallyPassed1() throws Exception { On 2015/02/26 ...
9 years, 2 months ago (2015-02-26 20:29:28 UTC) #9
kpreid_google
9 years, 2 months ago (2015-02-26 20:36:38 UTC) #10
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b