dedicated safe integer truncation integration test (#435)

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-12-17 10:25:41 +01:00
committed by GitHub
parent 9446132608
commit 25ee4eef5a
3 changed files with 51 additions and 4 deletions
+4 -4
View File
@@ -20,7 +20,7 @@ pragma solidity ^0.8.28;
"dest": {
"Instantiated": 0
},
"data": "e2179b8e"
"data": "0be0e4a60000000000000000000000000000000000000000000000000000000000000000"
}
}
]
@@ -29,12 +29,12 @@ pragma solidity ^0.8.28;
contract MLoad {
constructor() payable {
assert(g() == 0);
assert(loadAt(0) == 0);
}
function g() public payable returns (uint m) {
function loadAt(uint _offset) public payable returns (uint m) {
assembly {
m := mload(0)
m := mload(_offset)
}
}
}