diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index e3114944b..f419b847a 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -2192,8 +2192,9 @@ string YulUtilFunctions::updateStorageValueFunction( solAssert(_toType.storageBytes() > 0, "Invalid storage bytes size."); return Whiskers(R"( - function (slot, value) { - sstore(slot, (sload(slot), (value))) + function (slot, ) { + let := () + sstore(slot, (sload(slot), ())) } )") @@ -2204,6 +2205,9 @@ string YulUtilFunctions::updateStorageValueFunction( updateByteSliceFunctionDynamic(_toType.storageBytes()) ) ("offset", _offset.has_value() ? "" : "offset, ") + ("convert", conversionFunction(_fromType, _toType)) + ("fromValues", suffixedVariableNameList("value_", 0, _fromType.sizeOnStack())) + ("toValues", suffixedVariableNameList("convertedValue_", 0, _toType.sizeOnStack())) ("prepare", prepareStoreFunction(_toType)) .render(); } diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol index 2b90451ec..91755d4b7 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol @@ -17,6 +17,8 @@ contract C { } } +// ==== +// compileViaYul: also // ---- // test_store_ok() -> 1 // x() -> 0 diff --git a/test/libsolidity/semanticTests/smoke/alignment.sol b/test/libsolidity/semanticTests/smoke/alignment.sol index 621581468..bb4ba9317 100644 --- a/test/libsolidity/semanticTests/smoke/alignment.sol +++ b/test/libsolidity/semanticTests/smoke/alignment.sol @@ -18,6 +18,8 @@ contract D { return (stateBool, stateDecimal, stateBytes); } } +// ==== +// compileViaYul: also // ---- // stateBool() -> true // stateBool() -> right(true)