diff --git a/src/generated/Rainterpreter.pointers.sol b/src/generated/Rainterpreter.pointers.sol index 2ec16c66f..37d816c00 100644 --- a/src/generated/Rainterpreter.pointers.sol +++ b/src/generated/Rainterpreter.pointers.sol @@ -10,11 +10,11 @@ pragma solidity =0.8.25; /// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0x10c0deac502c70b279f7d2e754471dd350a6d963d1ade3de0f2468e1d8235433); +bytes32 constant BYTECODE_HASH = bytes32(0xd00f0e827724d7c7ced9e96d7eb3b9133a04f7fc0ddd8b988978c3b8f350445e); /// @dev The function pointers known to the interpreter for dynamic dispatch. /// By setting these as a constant they can be inlined into the interpreter /// and loaded at eval time for very low gas (~100) due to the compiler /// optimising it to a single `codecopy` to build the in memory bytes array. bytes constant OPCODE_FUNCTION_POINTERS = - hex"07f30825084909d50a9e0ab00ac20adb0aff0b330b440b550bf70c160cd40d840e080f4a107d0cd41176122812ca1342135313641364137513e0148b14a414b81516152f1548158115ac15c515de16051618167a16c81716176417b21800184e187f188d18db190c195a198b19d91a271b1d"; + hex"07f30825084909d50a9e0ab00ac20adb0aff0b330b440b550bf70c160cd40d840e080f4a107d0cd41176122812ca1342135313641364137513e0148b14a414b8151715301549158215ad15c615df16061619167b16c91717176517b31801184f1880188e18dc190d195b198c19da1a281b1e"; diff --git a/src/lib/op/logic/LibOpEvery.sol b/src/lib/op/logic/LibOpEvery.sol index 523ab6f1c..eb536b245 100644 --- a/src/lib/op/logic/LibOpEvery.sol +++ b/src/lib/op/logic/LibOpEvery.sol @@ -35,7 +35,7 @@ library LibOpEvery { } if (item.isZero()) { assembly ("memory-safe") { - mstore(stackTop, item) + mstore(stackTop, 0) } break; } @@ -57,6 +57,7 @@ library LibOpEvery { for (uint256 i = 0; i < inputs.length; i++) { value = Float.wrap(StackItem.unwrap(inputs[i])); if (value.isZero()) { + value = Float.wrap(0); break; } } diff --git a/test/src/lib/op/logic/LibOpEvery.t.sol b/test/src/lib/op/logic/LibOpEvery.t.sol index 137daa32b..c87d20f65 100644 --- a/test/src/lib/op/logic/LibOpEvery.t.sol +++ b/test/src/lib/op/logic/LibOpEvery.t.sol @@ -85,8 +85,13 @@ contract LibOpEveryTest is OpTest { checkHappy("_: every(0 5);", 0, ""); } + /// zero with a non zero exponent is false. + function testOpEveryEvalZeroWithExponent() external view { + checkHappy("_: every(0e5 5);", 0, ""); + } + /// Test that every without inputs fails integrity check. - function testOpAnyEvalFail() public { + function testOpEveryEvalFail() public { vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); bytes memory bytecode = iDeployer.parse2("_: every();"); (bytecode);