Yul object names with dots are accepted but ambiguous #15540
Labels
bug 🐛
low effort
There is not much implementation work to be done. The task is very easy or tiny.
low impact
Changes are not very noticeable or potential benefits are limited.
must have eventually
Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.
Description
An identifier like
A.B.C
is a valid name for a Yul object. However, the compiler also uses dots as separators in qualified object/data names. This creates ambiguity when names with dots are passed to builtins likedataoffset()
ordatasize()
.Such names are interpreted as paths by some parts of the compiler and as names by other parts. This results in errors or ICEs unless both possibilities are defined. And when both are defined, it's possible that some checks are getting bypassed.
Environment
Steps to Reproduce
Unreferenced object
unreferenced.yul
Dots in names are accepted and apparently cause no issue on their own.
Top-level subobject
top-level.yul
:The error is coming from Yul analysis, which means that it treats it as a path and expects a nested subobject.
Nested subobject
nested.yul
:This one probably passes Yul analysis but then fails later at a place that interprets the path differently.
Ambiguous subobject
ambiguous.yul
:Note the
0x07
- when assembling we're apparently choosing the top-leveldata
, again different from analysis.The text was updated successfully, but these errors were encountered: