Allow Yul literals longer than 32-bytes when used as literal arguments for builtins

This commit is contained in:
Kamil Śliwak
2020-06-24 15:05:38 +02:00
parent 062a999e85
commit 1b09b4f950
12 changed files with 89 additions and 2 deletions
@@ -0,0 +1,6 @@
{
let x := byte(31, "11112222333344445555666677778888")
}
// ====
// dialect: evm
// ----
@@ -0,0 +1,6 @@
{
let addr := loadimmutable("address")
}
// ====
// dialect: evm
// ----
@@ -0,0 +1,7 @@
{
setimmutable(loadimmutable("abc"), "abc")
}
// ====
// dialect: evm
// ----
// TypeError 9114: (6-18): Function expects direct literals as arguments.
@@ -0,0 +1,6 @@
{
setimmutable("address", 0x1234567890123456789012345678901234567890)
}
// ====
// dialect: evm
// ----
@@ -0,0 +1,7 @@
{
let name := "long___name___that___definitely___exceeds___the___thirty___two___byte___limit"
}
// ====
// dialect: evm
// ----
// TypeError 3069: (18-97): String literal too long (77 > 32)
@@ -0,0 +1,7 @@
{
let x := byte(40, "long___value__that___definitely___exceeds___the___thirty___two___byte___limit")
}
// ====
// dialect: evm
// ----
// TypeError 3069: (24-103): String literal too long (77 > 32)
@@ -0,0 +1,9 @@
{
setimmutable(
"long___name___that___definitely___exceeds___the___thirty___two___byte___limit",
0x1234567890123456789012345678901234567890
)
}
// ====
// dialect: evm
// ----