aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/eliminator/eliminator-test-output.js5
-rw-r--r--tools/eliminator/eliminator-test.js4
-rw-r--r--tools/eliminator/eliminator.coffee4
3 files changed, 7 insertions, 6 deletions
diff --git a/tools/eliminator/eliminator-test-output.js b/tools/eliminator/eliminator-test-output.js
index 876340de..d914a5da 100644
--- a/tools/eliminator/eliminator-test-output.js
+++ b/tools/eliminator/eliminator-test-output.js
@@ -76,9 +76,8 @@ function strtok_part(b, j, f) {
}
}
function py() {
- var $7 = HEAP[HEAP[__PyThreadState_Current] + 12] + 1;
- var $8 = HEAP[__PyThreadState_Current] + 12;
- HEAP[$8] = $7;
+ var $8 = HEAP[HEAP[__PyThreadState_Current] + 12] + 1 + 12;
+ HEAP[$8] = 99;
}
function otherPy() {
var $4 = HEAP[__PyThreadState_Current];
diff --git a/tools/eliminator/eliminator-test.js b/tools/eliminator/eliminator-test.js
index 4928134a..35bed0bb 100644
--- a/tools/eliminator/eliminator-test.js
+++ b/tools/eliminator/eliminator-test.js
@@ -88,8 +88,8 @@ function py() {
var $4 = HEAP[__PyThreadState_Current];
var $5 = $4 + 12;
var $7 = HEAP[$5] + 1;
- var $8 = $4 + 12;
- HEAP[$8] = $7;
+ var $8 = $7 + 12;
+ HEAP[$8] = 99;
}
function otherPy() {
var $4 = HEAP[__PyThreadState_Current];
diff --git a/tools/eliminator/eliminator.coffee b/tools/eliminator/eliminator.coffee
index 5b8ac43f..b78a5a7e 100644
--- a/tools/eliminator/eliminator.coffee
+++ b/tools/eliminator/eliminator.coffee
@@ -27,7 +27,9 @@ isGenerated = (ident) ->
ident in generatedFunctions
# Maximum number of uses to consider a variable not worth eliminating.
-MAX_USES = 3
+# The risk with using > 1 is that a variable used by another can have
+# a chain that leads to exponential uses
+MAX_USES = 1
# The UglifyJs code generator settings to use.
GEN_OPTIONS =