Skip to content

Instantly share code, notes, and snippets.

@dreamlayers
dreamlayers / gist:8463670
Created January 16, 2014 21:22
This is an improper fix for Emscripten relooper issue #1909, which is good enough for DOSBox. It avoids creating long chains of comparisons for switch statements, and greatly improves DOSBox performance in Firefox. This can generate assertion failures and JavaScript errors when running the relooper fuzzer. I have not observed any improperly runn…
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index de69e0e..ee3aedc 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -556,7 +556,7 @@ void Relooper::Calculate(Block *Entry) {
for (BlockSet::iterator iter = Curr->BranchesIn.begin(); iter != Curr->BranchesIn.end(); iter++) {
Queue.insert(*iter);
}
-#if 0
+#if 1