Bypassing the deployed bytecode with inline assembly in constructor makes it disappear from creation bytecode #15725
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
Compiling a contract that bypasses the runtime assembly through the use of inline assembly in its constructor results in bytecode that does not match the reported assembly output. The runtime assembly appears to be omitted. While the assembly is unused and unreachable, this seems to be a bug since the compiler does not have an explicit mechanism for stripping unused subassemblies. It also still reports the content of that subassembly as the deployed bytecode (
--bin-runtime
).I think that removal of unreferenced subassemblies would actually be desirable as a feature, but should be performed before assembling and the
--asm
output should match what actually ends up in the bytecode. The removal we implemented for EOF should be changed to be performed that way. If we reach assembling with unreferenced subassemblies (e.g. through import of hand-crafted assembly), that should just result in an error.Environment
Steps to Reproduce
test.sol
:Note that the creation bytecode is much shorter than the deployed bytecode and cannot possibly include it.
The text was updated successfully, but these errors were encountered: