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

Add sign extension assignment operator #18092

Merged
merged 2 commits into from Dec 23, 2020

Conversation

sylvainpelissier
Copy link
Contributor

Checklist

  • Closing issues: #issue
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the radare2book

Description

Introduce new ~= operator doing sign extension assignment of a register. For example:

> "ae 0x81,a0,="
> "ae 8,a0,~="
> ar a0
0xffffff81

This would simplify a lot of ESIL expressions for architecture using sign extension.

@github-actions github-actions bot added the ESIL label Dec 22, 2020
libr/anal/esil.c Outdated
static bool esil_signexteq(RAnalEsil *esil) {
ut64 src, dst;

char *p_src = r_anal_esil_pop (esil);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally it will be good to share most code with esil_signext, can you refactor this? we should be able to describe operations in a functional way without having to go into much details in the code. X= operations must be calling internally the X operation and then the = operation for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored to share code but doing that in a functional way is not obvious to me.

@codecov-io
Copy link

Codecov Report

Merging #18092 (1776c1c) into master (15d8de3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18092   +/-   ##
=======================================
  Coverage   41.75%   41.75%           
=======================================
  Files        1078     1078           
  Lines      351288   351297    +9     
=======================================
+ Hits       146678   146687    +9     
  Misses     204610   204610           
Impacted Files Coverage Δ
libr/anal/esil.c 76.03% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15d8de3...1776c1c. Read the comment docs.

@trufae trufae merged commit cad68b1 into radareorg:master Dec 23, 2020
@sylvainpelissier sylvainpelissier deleted the esil-signexteq branch September 17, 2022 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants