From 00fc6c96d415bd31ee5ecbec70a8e4de141674cd Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 16 Aug 2018 22:30:15 -0400 Subject: Adding EXTERN_PTR type --- mediumlevelilinstruction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mediumlevelilinstruction.cpp') diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index 9cf82b08..17ef88e7 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -168,6 +168,7 @@ unordered_map> {MLIL_MEM_PHI, {DestMemoryVersionMediumLevelOperandUsage, SourceMemoryVersionsMediumLevelOperandUsage}}, {MLIL_CONST, {ConstantMediumLevelOperandUsage}}, {MLIL_CONST_PTR, {ConstantMediumLevelOperandUsage}}, + {MLIL_EXTERN_PTR, {ConstantMediumLevelOperandUsage}}, {MLIL_FLOAT_CONST, {ConstantMediumLevelOperandUsage}}, {MLIL_IMPORT, {ConstantMediumLevelOperandUsage}}, {MLIL_ADD, {LeftExprMediumLevelOperandUsage, RightExprMediumLevelOperandUsage}}, @@ -1686,6 +1687,8 @@ ExprId MediumLevelILInstruction::CopyTo(MediumLevelILFunction* dest, return dest->Const(size, GetConstant(), *this); case MLIL_CONST_PTR: return dest->ConstPointer(size, GetConstant(), *this); + case MLIL_EXTERN_PTR: + return dest->ExternPointer(size, GetConstant(), GetOffset(), *this); case MLIL_FLOAT_CONST: return dest->FloatConstRaw(size, GetConstant(), *this); case MLIL_IMPORT: @@ -2248,6 +2251,12 @@ ExprId MediumLevelILFunction::ConstPointer(size_t size, uint64_t val, const ILSo } +ExprId MediumLevelILFunction::ExternPointer(size_t size, uint64_t val, uint64_t offset, const ILSourceLocation& loc) +{ + return AddExprWithLocation(MLIL_EXTERN_PTR, loc, size, val, offset); +} + + ExprId MediumLevelILFunction::FloatConstRaw(size_t size, uint64_t val, const ILSourceLocation& loc) { return AddExprWithLocation(MLIL_FLOAT_CONST, loc, size, val); -- cgit v1.3.1