summaryrefslogtreecommitdiffstats
path: root/courgette/ensemble_create.cc
diff options
context:
space:
mode:
Diffstat (limited to 'courgette/ensemble_create.cc')
-rw-r--r--courgette/ensemble_create.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/courgette/ensemble_create.cc b/courgette/ensemble_create.cc
index ec33689..62105b9 100644
--- a/courgette/ensemble_create.cc
+++ b/courgette/ensemble_create.cc
@@ -65,17 +65,21 @@ Status TransformationPatchGenerator::Reform(
// Element kind.
TransformationPatchGenerator* MakeGenerator(Element* old_element,
Element* new_element) {
- if (new_element->kind() == Element::WIN32_X86_WITH_CODE) {
- CourgetteWin32X86PatchGenerator* generator =
- new CourgetteWin32X86PatchGenerator(
- old_element,
- new_element,
- new CourgetteWin32X86Patcher(old_element->region()));
- return generator;
- } else {
- LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind();
- return NULL;
+ switch (new_element->kind()) {
+ case UNKNOWN:
+ break;
+ case WIN32_X86: {
+ TransformationPatchGenerator* generator =
+ new CourgetteWin32X86PatchGenerator(
+ old_element,
+ new_element,
+ new CourgetteWin32X86Patcher(old_element->region()));
+ return generator;
+ }
}
+
+ LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind();
+ return NULL;
}
// Checks to see if the proposed comparison is 'unsafe'. Sometimes one element