Commit Graph

244 Commits

Author SHA1 Message Date
Kamil Śliwak
fc37b4eeb6 Add Error::parseErrorType() 2023-09-30 00:06:29 +02:00
Matheus Aguiar
14aed39261 Introduce experimental analysis basic infrastructure 2023-09-11 12:29:44 -03:00
Kamil Śliwak
b1ead4af94 Order Error::Severity enum from most to least severe
- Also reorder Error::Type to match initial values for some consistency
2023-08-23 18:00:01 +02:00
Kamil Śliwak
c5b81b66cd Define Error::severity() 2023-08-23 18:00:01 +02:00
Kamil Śliwak
9adbced98e Remove parser error recovery mode 2023-08-22 12:00:11 +02:00
Kamil Śliwak
a59fc39f10 Use printErrorInformation() over printExceptionInformation() where possible 2023-08-11 14:15:56 +02:00
Kamil Śliwak
4020552e1d SourceReferenceFormatter: Remove the ineffective _withErrorIds parameter from formatExceptionInformation() 2023-08-11 14:15:56 +02:00
Kamil Śliwak
8407c8c615 SourceReferenceFormatter: Support full range of options in formatErrorInformation() 2023-08-11 14:15:56 +02:00
Kamil Śliwak
b7d2c8bb0a SourceReferenceFormatter: Line wrapping and unused includes 2023-08-11 14:15:56 +02:00
Nikola Matic
e81f2bdbd6 Purge using namespace std from liblangutil 2023-07-12 11:24:21 +02:00
Daniel Kirchner
44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00
Kamil Śliwak
b85a95f52d Refactor TokenTraits::isUnaryOp() not to treat + as a unary operator 2023-04-18 16:49:31 +02:00
hrkrshnn
802f895062 feat: introduce EVM Version Shanghai
Note: Paris is still the default
2023-04-12 00:10:24 +02:00
Leo Alt
aacbe72079 group unsupported warnings 2023-03-15 17:06:06 +01:00
Peter Lemenkov
93c8120a24 Initialize vars before use
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-24 12:06:01 +01:00
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