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:
xermicus
2025-10-15 22:39:42 +02:00
committed by GitHub
parent 2090830858
commit f46bea6a96
8 changed files with 62 additions and 12 deletions
@@ -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)
}
}
}