From ef6afdddaa0ab970b0fdfad685a6e9920283cffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20B=C3=B6l=C3=BCk?= Date: Tue, 19 May 2020 05:22:06 +0200 Subject: [PATCH] Implemented operand type validation. --- VTIL-Architecture/arch/instruction_desc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/VTIL-Architecture/arch/instruction_desc.cpp b/VTIL-Architecture/arch/instruction_desc.cpp index 0a9ab34..2831962 100644 --- a/VTIL-Architecture/arch/instruction_desc.cpp +++ b/VTIL-Architecture/arch/instruction_desc.cpp @@ -60,5 +60,17 @@ namespace vtil else branch_operands_rip.push_back( -op - 1 ); } + + // Validate operand types. + // + bool written = false; + for ( operand_type type : operand_types ) + { + if ( type >= operand_type::write ) + { + fassert( !written ); + written = true; + } + } } }; \ No newline at end of file