MLoad Error

function getValue(uint256 args) public pure returns (bytes32 result){
    assembly {
        mstore(0x40,args) // args 33 to 63 is not working
        result := mload(0x40)
    }
}

The function doesn't work for me if I give 33 as input.

Please help me to understand this

1 Like

Hello @aravindh

What is it that you are trying to do? location 0x40 in the memory stack is reserved for the "free memory pointer". Witting random values to it is dangerous and will break things

1 Like