aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-21 12:13:26 -0700
committeralon@honor <none@none>2010-10-21 12:13:26 -0700
commit3ce44a956a248c3c9aabf721ee9a52f92e92fa75 (patch)
tree85ee65bb37f2c278865f77053228f46808a1a849 /src/jsifier.js
parent057289cb695cf7483d5cf54be3d032f11f085fbe (diff)
optimize away unneeded FLATTENER[0]; enable gcc_unmangler test
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index f82a497c..d4e9f403 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -768,7 +768,11 @@ function JSify(data) {
if (typeData.flatFactor) {
indexes.push(getFastValue(curr, '*', typeData.flatFactor));
} else {
- indexes.push(toNiceIdent(type) + '___FLATTENER[' + curr + ']'); // TODO: If curr is constant, optimize out the flattener struct
+ if (curr == 0) {
+ indexes.push(0); // The first index is always 0 anyhow TODO: Assert this in the other places
+ } else {
+ indexes.push(toNiceIdent(type) + '___FLATTENER[' + curr + ']'); // TODO: If curr is constant, optimize out the flattener struct
+ }
}
} else {
if (curr != 0) {