Commit Graph

7421 Commits

Author SHA1 Message Date
Alex Beregszaszi
4675599170 Include SOL_VERSION_COMMIT/SOL_VERSION_PLATFORM in buildinfo.h 2017-01-17 12:54:58 +00:00
Alex Beregszaszi
350c7e7e2c Store strict version number in metadata (exclude the platform) 2017-01-17 12:54:58 +00:00
Alex Beregszaszi
9f9b7fb6f0 Explain how version numbers are built 2017-01-17 12:39:30 +00:00
chriseth
a466f26c45 Merge pull request #1570 from ethereum/astidentifiers
Deterministic AST node identifiers.
2017-01-17 11:35:21 +01:00
chriseth
99eaadd2cd Deterministic AST node identifiers. 2017-01-17 10:45:45 +01:00
Rhett Aultman
6ecb4aa36f Add git submodule init to build instructions (#1569) 2017-01-17 08:14:53 +01:00
Rhett Aultman
94b092d87c Provide fall-back method for contract lookup
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.
2017-01-16 23:47:04 -05:00
Rhett Aultman
88a2ac25e5 Revert "Fix contract lookup in tests"
This reverts commit f8914c6b28.
2017-01-16 18:07:48 -05:00
Rhett Aultman
43dbf01e73 Update changelog 2017-01-16 12:32:58 -05:00
Rhett Aultman
610156fb92 Fix bad merge artifact(?)
Looks like merging up munged line 188 in CommandLineInterface.cpp,
so that a string literal was being used where a global variable should
be.
2017-01-16 12:32:58 -05:00
Rhett Aultman
fda39afdba Modify library collision test
Since libaraies no longer collide on name but on fully-qualified name,
you can only induce collision by colliding them as idenfitiers.
2017-01-16 12:32:58 -05:00
Rhett Aultman
a7f8a1986a Revert "Move clashing libraries to common source in test"
This reverts commit c4a9ca5cfe7a8b4ba9d2d84392c57d5eefacd1f7.
2017-01-16 12:32:58 -05:00
Rhett Aultman
5a2331a9f6 Remove checkLibraryNameClashes()
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.
2017-01-16 12:32:58 -05:00
Rhett Aultman
1f30982ab5 Use fully-qualified names for linking, too
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
85c55c796a Remove unique error for contract collision
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
f8914c6b28 Fix contract lookup in tests
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
f10bf36ae3 Move fullyQualified() name to Declaration 2017-01-16 12:32:57 -05:00
Rhett Aultman
0c98e4b2da Stylistic corrections 2017-01-16 12:32:57 -05:00
Rhett Aultman
220ccfb492 Move clashing libraries to common source in test
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
e3b0827721 Push the error instead of throwing it
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
8f25bd54e3 Drop ':' if the source file name is empty
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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
071b936b37 Only avoid collision if it's the same file
@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.
2017-01-16 12:32:57 -05:00
Rhett Aultman
9e88f1eebe Tab whitespace cleanup (again) 2017-01-16 12:32:57 -05:00
Rhett Aultman
ce3082dec2 Tidy up the error message 2017-01-16 12:32:57 -05:00
Rhett Aultman
b24ca4fa23 Fix tab, drop stupid '!!!', change error message. 2017-01-16 12:32:57 -05:00
Rhett Aultman
f3a84eab91 Error out when contracts collide on name
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.
2017-01-16 12:32:57 -05:00
Nicola
79e5772b8a Update SolidityLexer.py (#1567)
Added number unit keywords
2017-01-16 10:26:09 +01:00
chriseth
8bdb99dcc5 Merge pull request #1564 from natzei/patch-1
Update SolidityLexer.py
2017-01-13 15:59:02 +01:00
Nicola
fb5583857a Update SolidityLexer.py
'payable' added as a keyword
2017-01-13 15:40:46 +01:00
chriseth
42ae5d0282 Merge pull request #1562 from ethereum/gas-tier-enum-class
Make enum Tier into an enum class
2017-01-13 14:35:36 +01:00
chriseth
392ef5f4e1 Merge pull request #1563 from ethereum/updateVersion
Update version to 0.4.9.
2017-01-13 13:57:30 +01:00
chriseth
10c2df8b33 Update version to 0.4.9. 2017-01-13 13:56:55 +01:00
Yoichi Hirai
20c62a132d
Make enum Tier into an enum class 2017-01-13 13:19:14 +01:00
chriseth
60cc166851 Merge pull request #1561 from ethereum/develop
Merge develop into release for 0.4.8
2017-01-13 13:05:02 +01:00
chriseth
e22672b7c7 Update Changelog.md 2017-01-13 12:18:22 +01:00
chriseth
bde0b40634 Merge pull request #1479 from ethereum/function_variable_mixin
Disallow mixin of functions and attributes under the same name
2017-01-13 09:36:00 +01:00
chriseth
14703ca002 Merge pull request #1560 from ethereum/cmake
Travis CI: Install latest CMake
2017-01-13 00:28:09 +01:00
chriseth
6b364fc2fe Merge pull request #1549 from ethereum/optimizeOptimizer
Optimize optimizer
2017-01-12 18:43:55 +01:00
chriseth
3cfa851f6f Minor changes from review. 2017-01-12 17:53:06 +01:00
chriseth
a32def5c42 Changelog entry. 2017-01-12 17:52:50 +01:00
chriseth
d34b561f68 Windows build fix. 2017-01-12 17:52:27 +01:00
chriseth
58509ca3aa Fix match groups. 2017-01-12 17:52:27 +01:00
chriseth
7127f2fdfd Fix debug output. 2017-01-12 17:52:27 +01:00
chriseth
da5e171f3b Optimize constant optimization. 2017-01-12 17:52:27 +01:00
chriseth
f1a4976ce6 Optimise simplification rules (sort into bins). 2017-01-12 17:52:26 +01:00
chriseth
a3b01eca27 Do not evaluate strings if assertion succeeds. 2017-01-12 17:52:26 +01:00
chriseth
652d8dab19 Optimize pattern matcher. 2017-01-12 17:52:26 +01:00
chriseth
afad40ac5a Optimise AssemblyItem::m_data. 2017-01-12 17:52:26 +01:00
Alex Beregszaszi
0cb95ac35e LLL: add test for (panic) in a sequence 2017-01-12 14:52:01 +00:00
chriseth
4713dd625d Fix error tag usage in lll. 2017-01-23 15:46:03 +01:00