Closed haltman-at closed 1 year ago
This seems to be a bit tricky and is related to how the "current source location" is set inside the compiler context. The jump target you mention is a "low level function" and its location might just be taken oven from the previous code. On the other hand, that low level function is created from the Main contract and this it should be valid to sets its location to the Main contract. This is how far I have got now.
If that's easier for you, I can make such utility functions always unmapped, but I still want to find out the cause of the difference between the two cases.
This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.
Hi everyone! This issue has been automatically closed due to inactivity. If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen. However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.
Description
Some code that, in a deployed context would be unmapped, in a constructor context instead gets mapped to the contract declaration node.
This is annoying for debugging because, when trying to track what's happened, it's hard to distinguish such implicit jumps from explicit ones in the code. In a deployed context we can tell them apart because one goes into unmapped code. In this context it's a lot harder.
Ideally, the code would remain unmapped in both the constructor and the deployed contexts.
Steps to Reproduce
Before the
CREATE
forSecondary
, there's a brief jump into what, if this weren't a constructor, would be unmapped code. Instead, however, the code is mapped to thecontract Main { ... }
node.Note that the bug will still occur if the troublesome segment is inside a different function that's called from the constructor.
Environment