Hey! I got a stack too deep error with viaIR yul compilation because an assembly block in Initializable.sol from OZ is not marked memory-safe. Actually none of these upgradeable getStorage functions seem to be using memory safe annotations. Are they actually not safe, or is it an oversight?
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
Hi @0xSamWitch,
Seems like you're right, I don't see a reason why this might be considered memory unsafe. Can you elaborate on the stack too deep error you're getting? The absence of the "memory-safe" annotation might be disabling optimizations.
I just have a large stack and via-ir can put stack variables into memory, but the compiler can't do it properly when there is an assembly block which is not marked safe. Which is why I get the compiler error. I was able to solve it myself by creating local copies of OZ contracts and marking those "memory-safe", I just wanted to make sure it was indeed safe to do