Fix crash on 0.4.10 when the file name contains a colon #556
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #555.
We provide output translation on older versions (<= 0.4.10) that did not support Standard JSON. The translation uses a regex that assumes that the file name never contains a colon. On <= 0.4.9 the name is empty so it's ok but on 0.4.10 this causes a crash when compiling contracts with a colon in the file name.
Also, it looks like the
contracts
dict in standard JSON had incorrectly split names until 0.4.20. On 0.4.11-0.4.19 apparently the compiler joins the file name and contract name into<filename>:<contractName>
and then (incorrectly) splits it again on the first colon. This results in a wrong split when there are multiple colons in the file name. This PR fixes tests to be able to handle that. It would probably be better to make this fix on a deeper level and make solc-js return correct Standard JSON for users too.