summaryrefslogtreecommitdiff
path: root/examples/mlil_parser/src/mlil_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/mlil_parser/src/mlil_parser.cpp')
-rw-r--r--examples/mlil_parser/src/mlil_parser.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/examples/mlil_parser/src/mlil_parser.cpp b/examples/mlil_parser/src/mlil_parser.cpp
index a4c10f61..a9411251 100644
--- a/examples/mlil_parser/src/mlil_parser.cpp
+++ b/examples/mlil_parser/src/mlil_parser.cpp
@@ -323,17 +323,10 @@ int main(int argc, char *argv[])
// Example of using visitors to find all constants in the instruction
instr.VisitExprs([&](const MediumLevelILInstruction& expr) {
- switch (expr.operation)
- {
- case MLIL_CONST:
- case MLIL_CONST_PTR:
- case MLIL_EXTERN_PTR:
+ bool status = MediumLevelILFunction::IsConstantType(expr.operation);
+ if (status)
printf(" Found constant 0x%" PRIx64 "\n", expr.GetConstant());
- return false; // Done parsing this
- default:
- break;
- }
- return true; // Parse any subexpressions
+ return !status;
});
// Example of using the templated accessors for efficiently parsing load instructions