Commit Graph

229 Commits

Author SHA1 Message Date
Peter Lemenkov
6a6bf303b5 libsolutil: Add missing include
This one is more obscure. It helps suppressing the following error while
compiling:

```
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:6: error: elaborated-type-specifier for a scoped enum must not use the 'class' keyword [-Werror]
   33 | enum class Instruction: uint8_t;
      | ~~~~ ^~~~~
      |      -----
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:23: error: found ':' in nested-name-specifier, expected '::'
   33 | enum class Instruction: uint8_t;
      |                       ^
      |                       ::
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:12: error: 'Instruction' has not been declared
   33 | enum class Instruction: uint8_t;
      |            ^~~~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:101:24: error: 'solidity::evmasm::Instruction' has not been declared
  101 |         bool hasOpcode(evmasm::Instruction _opcode) const;
      |                        ^~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.cpp:29:6: error: no declaration matches 'bool solidity::langutil::EVMVersion::hasOpcode(solidity::evmasm::Instruction) const'
   29 | bool EVMVersion::hasOpcode(Instruction _opcode) const
      |      ^~~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:101:14: note: candidate is: 'bool solidity::langutil::EVMVersion::hasOpcode(int) const'
  101 |         bool hasOpcode(evmasm::Instruction _opcode) const;
      |              ^~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:43:7: note: 'class solidity::langutil::EVMVersion' defined here
   43 | class EVMVersion:
      |       ^~~~~~~~~~
cc1plus: all warnings being treated as errors
```

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-04 16:22:18 +01:00
Rodrigo Q. Saramago
d9d9ab30a2 Update default evm version to paris 2023-01-30 17:57:08 +01:00
Rodrigo Q. Saramago
ef6ff2f055
Adds support for the EVM version "Paris".
Deprecates `block.difficulty` and disallow `difficulty()` in inline assembly for EVM versions >= paris.
The change is due to the renaming introduced by EIP-4399 (see: https://eips.ethereum.org/EIPS/eip-4399).
Introduces `block.prevrandao` in Solidity and `prevrandao()` in inline assembly for EVM versions >= paris.

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>
Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-01-23 18:50:36 +00:00
Vinay
9e7b85ac4b Improve Error Reporting of SemVer Parser 2022-11-25 13:09:09 -03:00
Alex Beregszaszi
eb8af2caec Add basic support for the EVM version Paris
This mostly means testing with evmone, but instruction renaming of difficulty->prevrandao is omitted.
2022-11-21 14:56:46 +01:00
chriseth
673b48138a
Merge pull request #13587 from ethereum/forward-declare-enum
[Trivial] Forward declare Instruction enum in EVMVersion
2022-10-20 14:40:22 +02:00
Marenz
9e674ba047 Forward declare Instruction enum in EVMVersion 2022-09-29 13:41:58 +02:00
Alex Beregszaszi
f5c85662ca Drop deprecated UndefMacros file 2022-09-27 23:35:32 +02:00
Alex Beregszaszi
565423c934 Replace use of boost::adapters::filtered with ranges::views::filter 2022-09-27 03:14:17 +02:00
nishant-sachdeva
eafd7218b7 refactored struct message to use std::variant for _typeOrSeverity 2022-09-20 19:20:43 +05:30
nishant-sachdeva
c8011d8719 Cleaning up helpers around errors 2022-09-19 10:51:14 +05:30
Marenz
1b5332c2b9 Fix spelling mistakes and CI spellcheck job 2022-08-18 14:38:19 +02:00
Matheus Aguiar
a73bf9136c Remove "garbage" code snippet from error message when in import-ast mode. 2022-07-06 13:43:29 -03:00
Matheus Aguiar
290bd4fd2d Added a flag to record when a source is reconstructed from JSON so garbage code snippets are not printed after source location. 2022-07-05 11:41:24 -03:00
William Entriken
2a957413d0 Update naming of Mainnet 2022-06-30 16:47:11 +02:00
Samuel Osewa
c21265f9f8 Changed error message for for Unicode character in non-unicode string literal
Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-06-15 16:12:24 +05:30
Daniel Kirchner
ece547204a Reorder member variables of unique error reporter to ensure proper initialization order. 2022-05-11 13:40:02 +02:00
Kamil Śliwak
3c5930dd8e Put arguments in parantheses in assert macro definitions 2022-04-06 22:26:21 +02:00
wechman
52dfccca98 Replace all locale-dependent operations with locale-agnostic counterparts 2022-03-07 17:23:08 +01:00
chriseth
5d571bb111
Merge pull request #12352 from ethereum/lineColumnTranslateForCharStream
LineColumn handling for CharStream.
2021-12-01 15:59:21 +01:00
chriseth
264b7bd857 LineColumn handling for CharStream. 2021-12-01 15:16:01 +01:00
chriseth
b6bd85202c Accessors for exceptions. 2021-12-01 14:26:23 +01:00
chriseth
86ce5f1da5 Use LineColumn type. 2021-11-30 00:08:22 +01:00
Leo Alt
fa48abf4f1 Add new info functions 2021-10-26 11:30:30 +02:00
shikharvashistha
cf005368d8 Added different colors for warning & error
Co-authored-by: shikharvashistha <shikharvashistha@yandex.com>
Co-authored-by: cameel <kamil.sliwak@codepoets.it>
2021-10-25 11:16:51 +01:00
Christian Parpart
35a81073b8 liblangutil: Adds a convenience helper method SourceLocation::contains(int _pos). 2021-10-14 17:35:03 +02:00
Kamil Śliwak
25eedfafe2 Define DebugInfoSelection 2021-10-11 20:34:48 +02:00
Christian Parpart
3f08b2269a Adds fmtlib as 3rdparty dependency for easier string composition. 2021-10-11 13:35:08 +02:00
Kamil Śliwak
0745842d46 Use BOOST_PP_OVERLOAD() to allow invoking the assertion macros without a message 2021-10-04 12:05:00 +02:00
Kamil Śliwak
4fe6aa1328 Add default messages to assertion macros 2021-10-04 12:05:00 +02:00
chriseth
1531863835 Split Common.h into Numeric.h. 2021-09-23 15:27:29 +02:00
Leo Alt
e72fa7fc10 Add new info severity 2021-09-13 22:48:22 +02:00
Leo Alt
d91f75deb8 Fix ICE on unique errors 2021-09-09 16:37:43 +02:00
Kamil Śliwak
98ab6d91ed SourceLocation::singleLineSnippet(): Handle \r\n line endings correctly 2021-09-07 17:18:22 +02:00
Kamil Śliwak
a7612ce873 Move the function for creating code snippets used next to source locations in assembly to liblangutil 2021-09-07 17:18:22 +02:00
Leo Alt
8e81df1bd3 Do not show redundant unsupported errors in SMTChecker 2021-08-27 16:25:09 +02:00
hrkrshnn
892700d769 Tests for basefee as identifier in inline assembly
Also added basefee to `EVMVersion::hasOpcode(...)`
2021-08-11 10:46:40 +02:00
hrkrshnn
79733fca48 Set default EVM version to London. 2021-08-11 09:54:14 +02:00
hrkrshnn
af1dabb555 Added EVMVersion london.
Also set the value of `block_base_fee` for testing to 7 wei.
2021-08-09 16:18:08 +02:00
Christian Parpart
d203c80abd Eliminate unnecessary m_source from Parser 2021-08-03 16:03:45 +02:00
chriseth
ffc5cfd9a5 Remove scanner from compiler stack. 2021-08-03 15:43:17 +02:00
Christian Parpart
af18b8afc2 Eliminate some unnecessary header inclusions in headers in Scanner.h and SourceReferenceFormatter.h 2021-08-03 15:43:17 +02:00
Christian Parpart
ac0c749a32 Eliminate some unnecessary header inclusions in headers in SourceLocation.h 2021-08-03 15:43:17 +02:00
Christian Parpart
81e9225304 Eliminate some unnecessary header inclusions in headers. 2021-08-03 15:43:14 +02:00
chriseth
01dc77e5a2 Properly assign source names for AST import. 2021-07-14 15:12:10 +02:00
chriseth
f75b55071e Remove CharStream from SourceLocation. 2021-07-14 15:12:07 +02:00
Christian Parpart
adb09452d8 ParserBase has virtual functions but did not have a virtual dtor. 2021-07-13 17:36:18 +02:00
Christian Parpart
f561c1e90b [langutil] ParserBase: make advance() overridable and make sure it's used. 2021-06-23 12:53:25 +02:00
TerranCivilian
c15501eea9 Remove unneeded include files 2021-06-07 12:53:18 -04:00
chriseth
d305c219d8 Fix namespace styles. 2021-05-27 17:41:04 +02:00