From 5912c32ab0da188196f5d486edc7fb5153f1ee65 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 12 Sep 2013 21:55:47 -0700 Subject: do not switchify illegally-typed switches --- src/jsifier.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/jsifier.js b/src/jsifier.js index 49f2c564..1f53b1a2 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1148,6 +1148,10 @@ function JSify(data, functionsOnly, givenFunctions) { if (VERBOSE && useIfs && item.switchLabels.length >= 6) { warn('not optimizing llvm switch into js switch because range of values is ' + range + ', density is ' + range/item.switchLabels.length); } + if (!useIfs && isIllegalType(item.type)) { + useIfs = true; + if (VERBOSE) warn('not optimizing llvm switch because illegal type ' + item.type); + } var phiSets = calcPhiSets(item); // Consolidate checks that go to the same label. This is important because it makes the relooper simpler and faster. -- cgit v1.2.3-18-g5258