aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorNathan Hammond <github.com@nathanhammond.com>2012-03-07 21:31:08 -0500
committerNathan Hammond <github.com@nathanhammond.com>2012-03-07 21:31:08 -0500
commit8219427f95f5e40e04822e2e2371d7adedc11cdc (patch)
tree426bce3f9f0e3692171f001b4c12fdd3f22a7a87 /src/jsifier.js
parent1c1e00f1ddf6a816872991e3d10cbfcc38ff5134 (diff)
parent84c9c225258ae9ab77eda0163b1368e95cb55f10 (diff)
Merge with @richardassar's changes.
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index b54aace3..5ad1573b 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -921,13 +921,16 @@ function JSify(data, functionsOnly, givenFunctions) {
});
var ret = '';
var first = true;
+ var signedIdent = makeSignOp(item.ident, item.type, 're'); // we need to standardize for purpose of comparison
for (var targetLabel in targetLabels) {
if (!first) {
ret += 'else ';
} else {
first = false;
}
- ret += 'if (' + targetLabels[targetLabel].map(function(value) { return makeComparison(item.ident, value, item.type) }).join(' || ') + ') {\n';
+ ret += 'if (' + targetLabels[targetLabel].map(function(value) {
+ return makeComparison(signedIdent, makeSignOp(value, item.type, 're'), item.type)
+ }).join(' || ') + ') {\n';
ret += ' ' + getPhiSetsForLabel(phiSets, targetLabel) + makeBranch(targetLabel, item.currLabelId || null) + '\n';
ret += '}\n';
}