Chromium Code Reviews| Index: courgette/ensemble_create.cc |
| diff --git a/courgette/ensemble_create.cc b/courgette/ensemble_create.cc |
| index ec33689dcd0e1facd808fa0fe82a57951c173c4a..62105b93e7dcbfab8f123bd5e44c3c17e577df3d 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( |
|
Chris Masone
2011/10/21 01:18:08
Hm. Why not just return the allocated object? Le
dgarrett
2011/10/21 01:22:38
Probably because the block that does real work I j
|
| + 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 |