Skip to content
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

Drop op_table parameter in analysis() #167

Merged
merged 2 commits into from
Sep 10, 2019
Merged

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 10, 2019

I believe the instruction_table is more precise name, but op_table is shorter and might be less mistaken with the table of instructions in the loaded program.

@codecov-io
Copy link

codecov-io commented Sep 10, 2019

Codecov Report

Merging #167 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
- Coverage   85.09%   85.04%   -0.06%     
==========================================
  Files          21       21              
  Lines        2241     2240       -1     
  Branches      219      218       -1     
==========================================
- Hits         1907     1905       -2     
- Misses        307      308       +1     
  Partials       27       27

}
();

const auto& op_table = get_op_table(rev);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danger of static init fiasco? in case op_tables in instructions.cpp is initialized after this

Copy link
Member Author

@chfast chfast Sep 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem does not apply to constexpr globals, but still I can move it inside the function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, haven't noticed constexpr

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good notice anyway.

const exec_fn_table& fns, evmc_revision rev, const uint8_t* code, size_t code_size) noexcept;
evmc_revision rev, const uint8_t* code, size_t code_size) noexcept;

EVMC_EXPORT const exec_fn_table& get_op_table(evmc_revision rev) noexcept;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you make it exported?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used in analysis tests (evmone is usually built as shared library).

@chfast chfast merged commit ab68bd3 into master Sep 10, 2019
@chfast chfast deleted the hide_instruction_table branch September 10, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants