mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
more randomness in the optimizations
This commit is contained in:
parent
1305fb0ff8
commit
ebe54acb77
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
uint8_t opcode = randGen();
|
uint8_t opcode = randGen();
|
||||||
// disregard all invalid commands, except of one (0x0c)
|
// disregard all invalid commands, except of one (0x0c)
|
||||||
if ((dev::eth::isValidInstruction(dev::eth::Instruction(opcode)) || (opcode == 0x0c)))
|
if ((dev::eth::isValidInstruction(dev::eth::Instruction(opcode)) || (randGen() > 128)))
|
||||||
randomCode += toHex(toCompactBigEndian(opcode));
|
randomCode += toHex(toCompactBigEndian(opcode));
|
||||||
else
|
else
|
||||||
i--;
|
i--;
|
||||||
@ -84,7 +84,7 @@ int main(int argc, char *argv[])
|
|||||||
\"randomVMtest\": {\n\
|
\"randomVMtest\": {\n\
|
||||||
\"env\" : {\n\
|
\"env\" : {\n\
|
||||||
\"previousHash\" : \"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6\",\n\
|
\"previousHash\" : \"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6\",\n\
|
||||||
\"currentNumber\" : \"0\",\n\
|
\"currentNumber\" : \"300\",\n\
|
||||||
\"currentGasLimit\" : \"1000000\",\n\
|
\"currentGasLimit\" : \"1000000\",\n\
|
||||||
\"currentDifficulty\" : \"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\n\
|
\"currentDifficulty\" : \"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\n\
|
||||||
\"currentTimestamp\" : 2,\n\
|
\"currentTimestamp\" : 2,\n\
|
||||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[])
|
|||||||
read_string(s, v);
|
read_string(s, v);
|
||||||
|
|
||||||
// insert new random code
|
// insert new random code
|
||||||
v.get_obj().find("randomVMtest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode + "55";
|
v.get_obj().find("randomVMtest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode + (randGen() > 128 ? "55" : "");
|
||||||
|
|
||||||
// execute code in vm
|
// execute code in vm
|
||||||
doMyTests(v);
|
doMyTests(v);
|
||||||
|
Loading…
Reference in New Issue
Block a user