-
Notifications
You must be signed in to change notification settings - Fork 6.2k
libevmasm: refactor asm-json export & add support for source list. #12799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
#include <sstream> | ||
#include <memory> | ||
#include <map> | ||
#include <utility> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. Never knew that C++ had such a catch-all header for basic stuff. I wonder if we should be using it more often instead of including things individually. |
||
|
||
namespace solidity::evmasm | ||
{ | ||
|
@@ -147,7 +148,8 @@ class Assembly | |
|
||
/// Create a JSON representation of the assembly. | ||
Json::Value assemblyJSON( | ||
std::map<std::string, unsigned> const& _sourceIndices = std::map<std::string, unsigned>() | ||
std::map<std::string, unsigned> const& _sourceIndices = std::map<std::string, unsigned>(), | ||
bool _includeSourceList = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this default to false to retain the old behaviour? Do we need a default value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now I set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, this should also be mentioned in the changelog. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats true! |
||
) const; | ||
|
||
/// Mark this assembly as invalid. Calling ``assemble`` on it will throw. | ||
|
@@ -167,16 +169,6 @@ class Assembly | |
unsigned codeSize(unsigned subTagSize) const; | ||
|
||
private: | ||
static Json::Value createJsonValue( | ||
std::string _name, | ||
int _source, | ||
int _begin, | ||
int _end, | ||
std::string _value = std::string(), | ||
std::string _jumpType = std::string() | ||
); | ||
static std::string toStringInHex(u256 _value); | ||
|
||
bool m_invalid = false; | ||
|
||
Assembly const* subAssemblyById(size_t _subId) const; | ||
|
@@ -222,6 +214,7 @@ class Assembly | |
std::string m_name; | ||
|
||
langutil::SourceLocation m_currentSourceLocation; | ||
|
||
public: | ||
size_t m_currentModifierDepth = 0; | ||
}; | ||
|
Uh oh!
There was an error while loading. Please reload this page.