mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 17:31: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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user