Do not allow msize in inline assembly if the Yul optimizer is active.

This commit is contained in:
chriseth
2019-05-28 12:54:33 +02:00
parent d7b5ea6761
commit df96648b1c
9 changed files with 85 additions and 7 deletions
@@ -0,0 +1,12 @@
contract C {
function f() pure public {
assembly {
let x := msize()
}
}
}
// ====
// optimize-yul: true
// ----
// Warning: The Yul optimiser is still experimental. Do not use it in production unless correctness of generated code is verified with extensive tests.
// SyntaxError: (52-101): The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction.
@@ -0,0 +1,8 @@
contract C {
function f() pure public {
assembly {
let x := msize()
}
}
}
// ----