mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 18:41:02 +00:00
llvm-context: do not trap zero length OOB heap access (#389)
Fixes https://github.com/paritytech/contract-issues/issues/120 --------- Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 932,
|
||||
"Computation": 2313,
|
||||
"DivisionArithmetics": 9103,
|
||||
"ERC20": 17479,
|
||||
"Events": 1692,
|
||||
"FibonacciIterative": 1508,
|
||||
"Flipper": 2098,
|
||||
"SHA1": 8176
|
||||
"Baseline": 914,
|
||||
"Computation": 2295,
|
||||
"DivisionArithmetics": 9085,
|
||||
"ERC20": 17499,
|
||||
"Events": 1674,
|
||||
"FibonacciIterative": 1490,
|
||||
"Flipper": 2102,
|
||||
"SHA1": 8158
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.24;
|
||||
|
||||
/* runner.json
|
||||
{
|
||||
"differential": true,
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "MemoryBounds"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract MemoryBounds {
|
||||
fallback() external {
|
||||
assembly {
|
||||
// Accessing OOB offsets should always work when the length is 0.
|
||||
return(100000, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,7 @@ test_spec!(function_type, "FunctionType", "FunctionType.sol");
|
||||
test_spec!(layout_at, "LayoutAt", "LayoutAt.sol");
|
||||
test_spec!(shift_arithmetic_right, "SAR", "SAR.sol");
|
||||
test_spec!(add_mod_mul_mod, "AddModMulModTester", "AddModMulMod.sol");
|
||||
test_spec!(memory_bounds, "MemoryBounds", "MemoryBounds.sol");
|
||||
|
||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||
vec![Instantiate {
|
||||
|
||||
Reference in New Issue
Block a user