From af3a4b06427eac386a7cf81e90dc5307884d5096 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 10 May 2017 10:34:37 +0100 Subject: Add simplification rule for SDIV(0,X) and SDIV(X,0) --- libevmasm/SimplificationRules.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libevmasm') diff --git a/libevmasm/SimplificationRules.cpp b/libevmasm/SimplificationRules.cpp index 4788d4d7..e6c51f95 100644 --- a/libevmasm/SimplificationRules.cpp +++ b/libevmasm/SimplificationRules.cpp @@ -132,6 +132,8 @@ Rules::Rules() {{Instruction::DIV, {X, 0}}, [=]{ return u256(0); }}, {{Instruction::DIV, {0, X}}, [=]{ return u256(0); }}, {{Instruction::DIV, {X, 1}}, [=]{ return X; }}, + {{Instruction::SDIV, {X, 0}}, [=]{ return u256(0); }}, + {{Instruction::SDIV, {0, X}}, [=]{ return u256(0); }}, {{Instruction::SDIV, {X, 1}}, [=]{ return X; }}, {{Instruction::AND, {X, ~u256(0)}}, [=]{ return X; }}, {{Instruction::AND, {X, 0}}, [=]{ return u256(0); }}, -- cgit