Commit Graph

7444 Commits

Author SHA1 Message Date
chriseth
df4ef74199 Add tests for internal constructor. 2017-01-20 19:22:39 +01:00
chriseth
2536bdd6d0 Report source location on "stack too deep" errors. 2017-01-20 19:01:19 +01:00
Yoichi Hirai
12b002b3b8 Merge pull request #1576 from ethereum/typeIdentifiers
Type identifiers.
2017-01-20 16:18:57 +01:00
chriseth
07b0a0a560 Make m_id const. 2017-01-20 15:56:56 +01:00
chriseth
7159944f0f Reset AST node IDs between compilation runs. 2017-01-20 12:00:16 +01:00
Yoichi Hirai
09403dd5ed Merge pull request #1587 from ethereum/fixFunctionVisibility
Fix default function type name visibility.
2017-01-19 16:24:25 +01:00
chriseth
da178d967f Properly escape user strings and lists. 2017-01-19 13:23:58 +01:00
chriseth
3fed790a56 Type identifiers. 2017-01-19 13:23:57 +01:00
chriseth
23a654ade8 Fix default function type name visibility. 2017-01-19 11:11:40 +01:00
chriseth
ba7dcbc15e Merge pull request #1583 from federicobond/fix-comment
Fix typo in comment
2017-01-18 19:28:55 +01:00
chriseth
7c18b785e3 Merge pull request #1584 from ethereum/tier
libevmasm: remove duplicate `Tier` from `Tier::xTier`s
2017-01-18 19:28:37 +01:00
chriseth
9ce30e9da0 Merge pull request #1585 from ethereum/libraryfallback
Provide fallback for linking.
2017-01-18 19:28:14 +01:00
chriseth
d3a391c136 Provide fallback for linking. 2017-01-18 17:41:36 +01:00
Yoichi Hirai
821997a1d3
libevmasm: remove duplicate Tier from Tier::xTiers
Synchronize with cpp-ethereum
2017-01-18 17:24:39 +01:00
Federico Bond
d40ae663ec Fix typo in comment 2017-01-18 12:43:23 -03:00
chriseth
28a05e5aa3 Merge pull request #1581 from ethereum/fixosx
Fix JSON output on macos.
2017-01-18 15:41:39 +01:00
chriseth
005e190885 Merge pull request #1397 from roadriverrail/contract_collision
Error out when contracts collide on name
2017-01-18 14:28:00 +01:00
chriseth
c16e141ffb Fix JSON output on macos. 2017-01-18 14:09:40 +01:00
chriseth
4f4963131b Merge pull request #1573 from ethereum/metadata-version
Store strict version number in metadata (exclude the platform)
2017-01-17 15:35:08 +01:00
chriseth
ed12b97761 Merge pull request #1574 from ethereum/docs-version
Explain how version numbers are built
2017-01-17 15:34:41 +01:00
chriseth
78b12e8f5c Merge pull request #1575 from ethereum/docs-copyright-date
Update copyright date in docs
2017-01-17 15:33:40 +01:00
Alex Beregszaszi
2bf89776ae Update copyright date in docs 2017-01-17 13:08:22 +00:00
Alex Beregszaszi
592c692bce Mention how our version maps to Semver 2017-01-17 13:01:55 +00:00
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