Skip to content

Solidity version 0.4.9#1622

Merged
chriseth merged 153 commits intoreleasefrom
develop
Jan 31, 2017
Merged

Solidity version 0.4.9#1622
chriseth merged 153 commits intoreleasefrom
develop

Conversation

@chriseth
Copy link
Contributor

No description provided.

pirapira and others added 30 commits January 13, 2017 13:19
'payable' added as a keyword
Added number unit keywords
The previous behaviour, courtesy of the [] operator in std::map, would
uncritically store a new ContractDefinition in m_contracts even when a
ContractDefinition already existed.  This "resolved" collissions on contract
names by clobbering the original one with the new one, and could lead to
scenarios where the clobber would only be discovered when the original
ContractDefinition could not be found or referred to, which was an unhelpful
InternalCompilerError.

This change checks the m_contracts map for a collision first and will not let
the ContractDefinition be changed to a new one once it's set, throwing a
CompilerError with information about the conflict.
@chriseth had suggested that it would be better if contracts were
referenced in a file:contract notation, and that we output .bin files
that prepend original path names if necessary to avoid a collision.

This commit is mostly a draft; it still needs to be run through the test
suite.
A large number of tests compile contracts while passing in an empty
string for the source name.  This leads to it being keyed by the name
":<contract>", while the tests try to look it up under the name
"<contract>".  This change resolves that issue by dropping the ':' in
cases where there is, effectively, no source file to prepend anyway.
Throwing a CompilerError on multiple contract definition violates the
expectations of the test suite, which thinks that compile() will
return false if the code can't compile.  This brings contract
collision reporting in line with most of the other errors.
Since contracts and libraries only collide if they share a common
source file now, this test only works if both libraries are in the
same source.
The fully-qualified name of a contract with no source unit is :<Name>
instead of just <Name>, so the test system needed to be adjusted
accordingly.
Because contracts are uniquely identified by their source unit, there
is no need for a unique error for this; it's actually covered by the
checker for double-declaration of identifiers.
Using libraries leaves behind a library link reference in the binary
which the linker must later resolve.  These link references were still
being generated by name and not by fully-qualified name.  This would
lead to a link-time collision between two libraries having the same
name but in different source units.

This change changes linker symbols over to fully-qualified names,
which resolves that issue.  This does potentially introduce a new
problem, which is that linker symbols appear to be limited to 36
characters and are truncated.  Storing paths extends the average
symbol size, and it would be great if truncation was from the tail
rather than the head.
The library name clash checker throws errors when two libraries of the
same name are spotted.  In a previous commit, this function was
rewritten to use fully-qualified names instead, which makes it redundant
to the checker for multiply-declared identifiers.  Since it no longer
serves a clear purpose, the function is being dropped.
Since libaraies no longer collide on name but on fully-qualified name,
you can only induce collision by colliding them as idenfitiers.
Looks like merging up munged line 188 in CommandLineInterface.cpp,
so that a string literal was being used where a global variable should
be.
Properly, contracts are now looked up via <source>:<contract> identifiers
called "fully qualified names."  As a modicum of backward-compatibility,
failure on a lookup is now backed up by seeing if the ":" exists at all,
and if it doesn't, then the known contracts are scanned for any matching
contract name.
Deterministic AST node identifiers.
wuestholz and others added 25 commits January 26, 2017 16:39
Add ethereum-git to archlinux dependencies
Refactor json return type generation.
Accept any kind of whitespace after natspec tags
Change translation of implicit throws
Mention in changelog that invalid as an opcode is valid inline assembly
Signed-off-by: VoR0220 <rj@erisindustries.com>
fix for linker wrt binaries generated with import statements
Make standard token compileable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants