aboutsummaryrefslogtreecommitdiffstats
path: root/LValue.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-03-11 01:22:19 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-03-12 19:53:00 +0800
commitb2fadf6b933e9034d5edb49608329fb0f7d015dd (patch)
treea0f606a88174cbdb99dcab2d3ee9a23fe47ae8d6 /LValue.cpp
parent73ce24ae75554b18a342e1e510f37f99057fdb1d (diff)
downloaddexon-solidity-b2fadf6b933e9034d5edb49608329fb0f7d015dd.tar.gz
dexon-solidity-b2fadf6b933e9034d5edb49608329fb0f7d015dd.tar.zst
dexon-solidity-b2fadf6b933e9034d5edb49608329fb0f7d015dd.zip
Conversion changes after renaming Hash/String to Bytes.
- Almost all end to end tests pass. Still needs a little bit of work
Diffstat (limited to 'LValue.cpp')
-rw-r--r--LValue.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/LValue.cpp b/LValue.cpp
index db3cd56b..7b8374b8 100644
--- a/LValue.cpp
+++ b/LValue.cpp
@@ -246,10 +246,11 @@ void StorageByteArrayElement::retrieveValue(SourceLocation const&, bool _remove)
// stack: ref byte_number
if (_remove)
m_context << eth::Instruction::SWAP1 << eth::Instruction::SLOAD
- << eth::Instruction::SWAP1 << eth::Instruction::BYTE;
+ << eth::Instruction::SWAP1 << eth::Instruction::BYTE ;
else
m_context << eth::Instruction::DUP2 << eth::Instruction::SLOAD
<< eth::Instruction::DUP2 << eth::Instruction::BYTE;
+ m_context << (u256(1) << (256 - 8)) << eth::Instruction::MUL;
}
void StorageByteArrayElement::storeValue(Type const&, SourceLocation const&, bool _move) const
@@ -265,8 +266,9 @@ void StorageByteArrayElement::storeValue(Type const&, SourceLocation const&, boo
m_context << eth::Instruction::DUP2 << u256(0xff) << eth::Instruction::MUL
<< eth::Instruction::NOT << eth::Instruction::AND;
// stack: value ref (1<<(32-byte_number)) old_full_value_with_cleared_byte
- m_context << eth::Instruction::SWAP1 << eth::Instruction::DUP4 << eth::Instruction::MUL
- << eth::Instruction::OR;
+ m_context << eth::Instruction::SWAP1;
+ m_context << (u256(1) << (256 - 8)) << eth::Instruction::DUP5 << eth::Instruction::DIV
+ << eth::Instruction::MUL << eth::Instruction::OR;
// stack: value ref new_full_value
m_context << eth::Instruction::SWAP1 << eth::Instruction::SSTORE;
if (_move)