Skip to content

Drop op_table parameter in analysis()#167

Merged
chfast merged 2 commits intomasterfrom
hide_instruction_table
Sep 10, 2019
Merged

Drop op_table parameter in analysis()#167
chfast merged 2 commits intomasterfrom
hide_instruction_table

Conversation

@chfast
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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