aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 9032da3e..13602e32 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -476,13 +476,14 @@ function analyzer(data) {
var nextEntries = keys(entryLabel.outLabels);
dprint('relooping', ' Creating simple emulated, outlabels: ' + nextEntries);
-// if (nextEntries.length == 1) {
-// replaceLabelLabels([entryLabel], set(nextEntries), 'BNOPP'); // remove unneeded branch
-// } else {
+ if (nextEntries.length == 1) {
+ replaceLabelLabels([entryLabel], set(nextEntries), 'BNOPP'); // remove unneeded branch XXX - this is dangerous, as we may
+ // have 1 next entry, but 1 or more B-labels...
+ } else {
nextEntries.forEach(function(nextEntry) {
replaceLabelLabels([entryLabel], set(nextEntry), 'BJSET' + nextEntry); // Just SET __label__ - no break or continue or whatnot
});
- // }
+ }
return {
type: 'emulated',
labels: [entryLabel],
@@ -604,6 +605,7 @@ function analyzer(data) {
// spaghetti - cannot even find a single label to do before the rest. What a mess.
// TODO: try a loop, if possible?
dprint('relooping', ' WARNING: Creating complex emulated');
+ throw "Spaghetti encountered in relooping."
return emulated;
}